Are you actually hooking that code? Nothing will run mario_update if you aren't hooking it. To hook the function, simply do this:
hook_event(HOOK_MARIO_UPDATE, mario_update)
HOOK_MARIO_UPDATE is the hook event, this will make it so every time mario updates, your mario_update function runs.