I made an integer that increases when you press the Z key while decreasing automatically at a slightly slower rate, forcing you to press the key rapidly to outpace the decrease. Meanwhile, there is a timer running in the background with it's remaining time being displayed above the player. If it ends, its timeout signal is received by the player's and frog hand's scripts, causing the QTE to end and you losing oxygen if it's the grab QTE or getting a game over if it's the ghost QTE. If the integer reaches its required value, the timer is stopped and you succeed at the QTE.