Probably you want a JS expert, which I am not at all. I tend to use JS only when I cannot achieve my goal with CP's functionality.
My suspicion: you think that time restarts on each slide which is not the case. Have a look at:
I use the explained terms in this action (just an example):
Thank you very much for your reply and links provided. It helped me a lot.
Looks like you have a couple typos in your code.
Missing one of the 'I's
Also, the 'W' in window needs to be lowercase.
As an afterthought: