You have this 'away' timer in place. It tells you how long the game has been offline.
It actual tells you also how long the game is running.
Just set a variable to round(TimeAwayL.ElapsedTime("away")), but this time only once and when it is zero (first start). The difference between the actual round(TimeAwayL.ElapsedTime("away")) and that variable = the online time.
Now the total time is just = TotalTime + that variabele (online time). TotalTime = zero for first run. The offline time (you have that one allready in place), we handle once on getting from the local storage.
You have to store total time in the local storage.
24 hours is 86400 seconds. (if i count right) So, its the same thing as you do allready with your build time.
So on TotalTime getting from the local storage.
TotalTime = TotalTime + away time (away time has to been get allready)
round(TotalTime /86400) gives you the amount of times this total time passed 24h.
If its bigger then 1 do the random thing
set TotalTime to (TotalTime) - (round((TotalTime /86400) * 86400), this sets the total time to the remaining second left to complete again a 24 hours cycle.
Say your total time is 216000... round(216000/86400) gives you 2 (2.5 rounded) ... means there are 2 times 24 h passed. Now there is still .5 times 24 hours left, and have to start from there for the new cycle. (TotalTime) - (round((TotalTime /86400) * 86400) gives you what is left.
Now the total time is just = TotalTime + that variabele (online time) again.
You do the same with buildtime, where you have to use ceil instead of round, because it is zero based.