Yanfly Damage Core - Damage Formula Issues

I'm trying to create an attack for a boss that hits four times. It's meant to be freakishly powerful without any buffs or debuffs in place (it'll kill the player in two hits), but still capable of hurting the player with maximum buffs/debuffs in place.

I tried balancing the skill in question without the use of the damage core plugin, but I couldn't manage something that both hurt the player with maximum buffs/debuffs in place and didn't completely annihilate the player without any buffs/debuffs in place. So I put this into the notetag box:
<damage formula>
value = (a.atk * 2 + a.mat * 2) - (b.def + b.mdf);
if (value <= 0)
{
value += 400;
}
</damage formula>

Now the problem I'm having is that while it accomplishes the intended result for a neutral playing field, it strangely does MORE damage when only the boss is debuffed. Furthermore, only the player having buffs makes it do LESS damage when both the player is buffed and the boss is debuffed.

The exact numbers were 284 (neutral), 296 (boss debuffed), 48 (player buffed), and 60 (player buffed, boss debuffed). All of this is per hit.

I imagine I'm just inputting it wrong; I have very little JavaScript experience. If I am, what's the correct way to input this?

Edit: For what it's worth, the buff formula I'm using:
if (this._buffs[paramId] < 0) {this._buffs[paramId] * 0.375 + 1.0;} else {this._buffs[paramId] * 0.50 + 1.0;}

The boss's attack stats are both 122.5, and the player's defensive stats are both 103.

Edit2: I managed to figure out the issue myself; as it turns out, it was working as intended. It was just that the 400 pushed the boss debuffed and both player buffed/boss debuffed damage over the values for the other two.

I've also since switched to a different damage formula that accomplishes what I was trying to do in the first place (if still rather low when debuffs are factored in), so this topic isn't really needed anymore.

In hindsight I probably should have put this in the Damage Formula topic as opposed to making a completely new topic here.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-damage-core-damage-formula-issues.81365/