try using:
Time Oline - $duration($calc($ctime - $4))
Idle Time - $duration($3)
See if that helps
In case this is wrong or I missed the point entirely, it seems like you wanted to convert time online & idle time to a real value so if this isnt the case, I apologise