Player Triple Jump

I have set up a triple jump for my character in a similar vain to Super Mario 64. I currently have a variable that counts if the player has jumped three times and then resets the Variable back to zero after the third jump. The Variable only increments when standing on the floor to prevent the player from spamming the jump button while in the air. However I want the player to have to press jump again as soon as he hits the ground in order to get the next level of jump, currently he can move around the level and then get the bonus height at any time. How do I go about setting this up?

Add an additional bool LandedPrimed or something, only allow the third jump if this is set to true.

Add a DateTime variable, LastLandedTime

When the player lands set LandedPrimed to false and LastLandedTime to the current UTC time.

When the Player tries to jump and they’re on the ground, check the current UTC time and see if its within your threshold of land-to-jump-time-for-triple-jump, if it is, then set LandedPrimed to true.