local STATE_MEGA_SHOOT_AIR = 500

local function JumpFireAirFrame()
    for player in players.iterate do
        if player and player.mo and player.mo.skin == "megaman" then
            if player.pflags & PF_JUMPED ~= 0 and player.cmd.buttons & BT_ATTACK ~= 0 then
                player.mo.state = S_MEGA_SHOOT_AIR
            end
        end
    end
end

addHook("ThinkFrame", JumpFireAirFrame)