Just study the code closely as I have to go which is why I whipped this up so quickly.
I think you can incorporate the rest of what you need (horizontal movement/jumping) on your own. Just use fastloops for anything that moves in more than 1 pixel increments.