Hello!
I'm no expert as I'm quite new to this but I've done something similar in one of my games so here's what I did:
From what I can see, your main problem is that the Time Code passage includes the (set: $hour to 0)(set: $min to 0) as this then automatically undoes any change you made to the variable in later passages.
I've just done a quick test in Harlowe 3.0.1 with the following code, which might be easier for you.
In the header passage with the header tag:
(if: $min is 60)[(set: $hour to $hour + 1)(set: $min to $min - 60)]
(else-if: $min > 60)[(set: $hour to $hour + 1)(set: $min to $min - 60)]
It is now $hour:$min
Then in the Start passage (the first one of the story) you should set the $min and $hour to the times you want the game on. I just did $hour as 2 and $min as 20 for my test.
Start passage:
(set: $hour to 2)(set: $min to 20)
[[start here]]
I then set it so that the Start passage (which could be your game title and a start button) has a no-header tag, and then put this in the CSS so that this passage doesn't show the header (as it shows the time of 0:0 because the variables haven't updated)
html.no-header tw-header {
display: none;
}
Then in each passage where you want time to pass such as in the bear encounter, you'll just need to add on the hour or min that has passed.
(set: $hour to $hour+11)(set: $min to $min+15)
You are in a dark forest, you see a [[bear]]
When you follow the link to the next passage the time should have updated and be displayed automatically at the top of the page. It went above 12h and 60min with no problems. You may want to add in the conversion of 24 hours to one day in a new variable and add that into the 'The time is Xdays, Xhours, Xmins) for when you go over 24 hours.
I hope this helps, but let me know if anything doesn't work, or doesn't make sense.
The Tame Historian