The 'inc %a' at the end is in the wrong place. It's not being incremented.

You're using '$1-' in multiple places, even though you've already put your '$1-' into '%cmsg.nicks'.

What are the intended arguments?
Code:
/cmsg <nick[,nick[...]]> <message>

If this is so, why are you using '$gettok($1-,1,44)' instead of simply '$1' ? Also, the message will be simply '$2-'.

So, something like this I guess:
Code:
alias cmsg {
  var %cmsg.nicks = $iif($1, $v1, $$input(Space or Comma separated,e,Matching nicks))
  %cmsg.nicks = $replace(%cmsg.nicks($chr(44), $chr(32)
  var %a = 1, $b = numtok(%cmsg.nicks, 32)
  while (%a <= %b) {
    var %cmsg.msg = $iif($2, $2-, $$input(Common message,e,,$iif(%cmsg.msg,$v1)))
    var %cmsg.nick = $gettok(%cmsg.nicks, $a, 32), %c = 1, %d = $comchan(%cmsg.nick, 0)
    while (%c <= %d) {
      var %cmsg.chans = %addtok(%cmsg.chans, $comchan(%cmsg.nick, %c), 44)
      inc %c
    }
    inc %a
  }
}