Where you count voices like $nick($2,0,v) you could also count them by the prefix symbol like $nick($2,0,+)
You can do the same thing for other modes, using either the channel-mode or the nick-prefix.
The exception is when the mode-letter has already been previously defined. For example, when protected-op is given mode +a, you can't use $nick($2,0,a) because that's already defined as 'all'. But if owner and protected-op have ~ and & you can use $nick($2,0,~) $nick($2,0,&)
When doing this for halfop, if you use % instead of h, be sure the % isn't the 1st character of an alphanumeric string or it looks for a %variable instead.