Currently, in order to find out which connection the $active is in, a script needs to loop through them all until it finds a match for $cid.

It would be more straightforward if either there was a $con equivalent to $cid, or else if $scon(N) or $scon(N).identifier returned for the active connection for N being -1

Code
alias con { var %i 1 | !while ($scon(%i).cid != $cid) !inc %i | !return %i }