You can use
$duration($nick($chan,NICKNAME).idle)
To get the idle time of a person, in this case, replace NICKNAME with $2. Although, this will return the idle time in the active channel.