How do I subtract seconds on timer when button is clicked?

Hi! I am coding a game for school and I can't figure out how to make it so that if they press the wrong button a few seconds will be subtracted from their time(clock). It's my first time actually coding using MIT app inventor so I would like some help please. Thank you!

usually you will have a global variable, which stores the remaining time
to subtract a few seconds just use the subtract block from the math drawer

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.



dont disturb the above blocks keep it as it is
blocks (4)
change the value if u need 5 second timer set 5 x 1000 =5000 and 10 min timer set 10 x 60 =600 seconds x 1000 =600000

if button 1 click it subracts 1 second if u need to subract 3 second set - 3000