Thanks for the comment, calinou.
Whew, fixing the checkboxes for those weapon modes was much more complex than expected: Setting up some variable copies with a different sign was not enough, because when the <onchange> block gets executed, the <var> still holds the old value (before click event) and cannot be copied back reasonably
In the end, I recreated the entire guibitfield method and expanded it in such a way that it allows a <var> with a negative sign, which can be toggled via right-click.
Otherwise, there's just a bunch of small things I fixed. Will have to take another look at $servertype later.