Stop player from diving at the same frame at jumping

like the tittle said

if the player held down the dive button and then pressed the jump button (or pressed both at the same time) the player would dive while still being on the floor and it would break some of the code that is relating to diving

heres the relevent code

make a timer to ensure that the dive condition can only be hit after the jump has been pressed

how do i do that? T-T