How would I create a decrease timer function used in this video?

Cancel the timer and then reset it.