OK – so you’re referencing $event_passed in their but haven’t actually defined it.
These templates in a sense stand alone – they don’t automatically inherit the symbol table of the parent template, so you’d need to add a line somewhere (probably near the top) setting $event_passed appropriately.