I think your problem is here:
if (seconds > 60) {
seconds -= 60;
minutes = (seconds / 60).toFixed(0);
if (minutes > 60) {
minutes -= 60;
hours = (minutes / 60).toFixed(0)
}
}
When seconds is greater than 60, you just take 60. If seconds is 189, for example, you'll get 129 instead of 9, which is what you want. You've got to calculate the minutes, then do:
seconds = seconds - (minutes * 60);
You've got to do the same with minutes, but taking hours.