Well, I first make four different functions- addinv, subinv, addstamina, and normal state. I then make two sprites- one player sprite- and a double jump sprite (both left/right) and the double jump sprite has a gravity of -10 with "up requires solid checked" the functions are-addinv but the item isn't removed after use. it gives uses an inv item called Stamina+1 with 1 max and 1 int(NOT GLOBAL). I also have a function called sub inv that is simular but subtracts Stamina+1. When the limit is reached of subinv, the function normal state is activated- which switches the player back to the primary state.(New inst, Del old Spr., and Sm loc. as old) Add stamina is global- not inital touch- and uses Stamina +1 but doesn't remove it. It gives you 1 stamina- and if the limit is hit it activates sub inv and resets to its opposite limit. After all of that is done, make a new inv item called doublejump(max2int2) and a new function called jump. It is global, but uses your jump key initial press to add the item called doublejump. Make a function that switches you to your doublejumpsprite but isn't global. And finally make a function that uses 2 doublejump items (remove after use) and your jump key initial press and is global that activates a series of functions... doublejump and then addinv. Then you're done!!!! It looks very long but really isnt. If you want a template for this I can send it to you as a GDP.
It looks like I have outsmarted the creator of SGDK!!! HA HA HA!!!!!!!
( I have an IQ of 210: no lie!)