window.fn = inside an IIFE is not reliable in all script-loading contexts. Move vvPtPhase1/2, vvPtOnboard, vvPtOffboard and their _vvPtRun helper above the IIFE as plain top-level function declarations — unconditionally global and reachable from onclick= attributes.