You seem to all want to go pretty complex. What about making it simpler like:
- have the default “Jump” function do its job
- add 2 boolean variables (one as flag for “first jump” and one as flag for “double jump”)
- double-jump only if “double jump” flag is false
- first time you jump set the first flag, second time you jump set the second flag
- add Z velocity as an action when jumping (in addition to default “jump”, that’s no big deal)
- when player lands reset both flags to false and you’re good to go again