in a new remote script;
alias retmodes {
var %modes = $chan($1-).mode
if ($isid) {
return $iif(%modes,%modes,n/a)
}
else {
echo $chan modes: %modes
}
}

then use this in popups:
.Chan Modes
..( $+ $retmodes($chan) $+ ):return