Code:
raw 366:*: set $+(%,topic,.,$chan) $chan($2).topic
on @*:topic:#: {
 if (%topic. [ $+ [ $chan ] ]) {
  if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
  else { set %topic. [ $+ [ $chan ] ] $1- }
 }
}
This should do it smile