Why are you re-hiding windows that are already hidden?
Code:

alias hidetask {
  window                                         $&
    $iif($window($1-).state == minimized, -h,    $&
    $iif($window($1-).state == normal,    -hr,   $&
    $iif($window($1-).state == maximized, -hx))) $&
    $iif($2, $+(",$1-,"), $1)
}

Using this version, you can /hidetask Status Window or some other multi-word window name (like sends and gets), as well as channel, query, chat or fserve windows.