MZ Contrary of an "if"

How can I write the contrary of

if ((a.isStateAffected(5))||(b.isStateAffected(5)))
Hello,
if (!(a.isStateAffected(5)) || (b.isStateAffected(5)))
I think in some languages there's also unless, but don't quote me on that one.
I think in some languages there's also unless, but don't quote me on that one.
Ruby does. I don't know of any other language that does, however.

And yes, in every other language, you'd need to invert the condition. In JavaScript this can be done using the "not operator" !. If for example the condition is:
JavaScript:
a.isStateAffected(5) || b.isStateAffected(5)

then the inversion would either be:
JavaScript:
!(a.isStateAffected(5) || b.isStateAffected(5))

or:
JavaScript:
!a.isStateAffected(5) && !b.isStateAffected(5)

The second example comes from boolean algebra, specifically De Morgan's law:
  • not (A and B) == not A or not B
  • not (A or B) == not A and not B

It doesn't matter which you choose, and both produce the same result.
The logical NOT operator despite detailed info still confuses me and I just rely on the != comparison operator.
The logical NOT just takes a boolean value (true or false) and inverts it. True becomes false and false becomes true. Nothing more to it.
In the above example the function user.isStateAffected(x) returns the value true if the battler is affected with the state with the id x and false otherwise. If we now invert that value our end result becomes false if the battler is affected with the state with the id x and true otherwise.
The logical NOT operator despite detailed info still confuses me and I just rely on the != comparison operator.
In addition to the above explanation - there's no need for confusion because you use these two things in the exact same way.

Any time you would say
Code:
if (myThing != true)
you can say
Code:
if (!myThing)
That's all there is to it.

The only difference is if, for some reason, you were saying
Code:
if (myThing != false)
in which case there's no need for a comparison operator at all, you simply do
Code:
if (myThing)
That made me understand it completely clear O_O

Original thread: https://forums.rpgmakerweb.com/threads/contrary-of-an-if.151406/