How do I control Jump speed using physics?

So I was messing with physics trying to create a good mario feel for the player. I have 3 objects attached to Mario to detect collisions. A floor, left wall, and right wall. I have everything working how I’d like except for the jump speed. When the “Y” button is pushed mario will run rather than walk. I didn’t want this action to be performed in mid air. I want to velocity to be whatever it was on the ground without changing. Meaning that if mario isn’t running and jumps, the jump speed will be slow the whole jump even if “Y” is pushed mid air. If he’s running while he jumps it will be faster whether or not the “Y” button is released in mid air. Can anyone te6me what I’m doing wrong?

You know what you want:

So apply what you said to your events sheet.
If Y is pressed while on the ground, activate a run variable.
If the run variable is active, apply the faster jump.
If Y is pressed again while on the ground, deactivate the variable.