Code:
alias md {
  if $me !isop $1 { echo -a You are not OP in $1 | return }
  var %x = $nick($1,0,v) | while (%x) { 
    var %r = %r $nick($1,%x,v)
    if ($numtok(%r,32) = $modespl) { mode $1 - $+ $str(v,$modespl) %r | unset %r } 
    dec %x
  }
  if (%r) { mode $1 - $+ $str(v,$numtok(%r,32)) %r }
}

Usage: /md #channel