Make skill deal 2x damage when target is affected by either state

Let me clarify a few things before explaining the issue. I use Lunatic Damage for damage formulas because I reworked how critical damage works, so that instead of multiplying the total of the damage formula by 3, it now multiplies the user's ATK / MAT by 2 and then take into account the enemy's defenses. This means that for most attacks I have to type something like this:

if b.result.critical == true;
a.atk * 4 - b.def * 2;
else; a.atk * 2 - b.def * 2;
end

Now the issue. I have a skill named "Mordhau Strike" which normally deals "a.atk * 2 - b.def * 2" damage, but when it hits an opponent affected by Stun OR Paralysis, it deals "a.atk * 4 - b.def * 2" damage. So I tried typing out this for the damage formula:

if b.result.critical == true && b.state?(Stun ID) or b.state?(Paralysis ID);
a.atk * 8 - b.def * 2;
elsif b.result.critical == false && b.state?(Stun ID) or b.state?(Paralysis ID);
a.atk * 4 - b.def * 2;
elsif b.result.critical == true;
a.atk * 4 - b.def * 2;
else; a.atk * 2 - b.def * 2;
end

When I attack an enemy that is not affected by Stun or Paralysis, the skill works correctly because it deals "a.atk * 2 - b.def * 2" damage when it doesn't crit and "a.atk * 4 - b.def * 2" damage when it does crit. But when I hit an opponent that is affected by Stun or Paralysis, it ALWAYS deals a.atk * 8 - b.def * 2, whether it crits or not. This isn't what I was looking for, because if the enemy is stunned or paralyzed and the attack isn't a critical hit, it should deal "a.atk * 4 - b.def * 2" damage.

How do I fix this? Thanks in advance.
Try this:
Code:
multi = 2
multi *= 2 if b.result.critical
multi *= 2 if b.state?(stn_id) || b.state?(par_id)
a.atk * multi - b.def * 2

Edit: Oops, should be multiplied instead. Fixed.
why not integrate the extra vulnerability to damage into the state itself?

😳
@gstv87 It may be skill specific, based on the description given.

Btw, you need to add parenthesis to your first if statement to get your original formula to work.
Code:
if b.result.critical && (b.state?(stn_id) || b.state?(par_id))
  a.atk * 8 - b.def * 2
elsif b.result.critical || b.state?(stn_id) || b.state?(par_id)
  a.atk * 4 - b.def * 2
else
  a.atk * 2 - b.def * 2
end
@Rinobi Thanks for the help, adding the parenthesis solved everything.

Original thread: https://forums.rpgmakerweb.com/threads/make-skill-deal-2x-damage-when-target-is-affected-by-either-state.81937/