Try rex_time_away plugin.
Call "Action:Start timer" when left. You might need to call it every tick (or every second/minute) to prevent left game without logging out.
Then get the elapsed time by "Expression:ElapsedTime" at next login.
So, start the timer on end of layout?
At start of layout get elapsedtime?
:/ Maybe I should read up some more haha.