Making a weapon that deals more damage based on states?

I am planning on making a weapon that works like this, where "foe that is a Calvary unit" is a state:

This weapon deals increased damage when used against a foe that is a Calvary unit.

Essentially, I want the attack with the weapon to do normal damage, but if the foe is "inflicted" with the "Calvary unit" state, the weapons does, say, 25% more damage than if the foe didn't have that state. (In a nutshell, I am trying to recreate weapons similar to Fire Emblem's Armorslayer,, Wyrmslayer, Beast Killer, Pike-Ruin Club, etc)
Have you considered maybe trying to do that with elemental weakness? The foe who has cavalry state is weak to cavalry elemental damage (ie takes, say, 200% of damage which is cavalry elemental) and then your weapon does cavalry elemental damage. Unless you want to use elements also for "real" elements, since I'm not sure a weapon can do multiple elements..

I'm sure there are other ways to do this but this came first to my mind.
Here's a nitty gritty version of it. This requires Yanfly's Battle Engine Core and Skill core to work. These can be found on his website:
Replace "X" with the state ID.
http://yanfly.moe/
<Damage Formula>
if (target.isStateAffected(x)){
value = (DAMAGE FORMULA) * 1.2;
}else{
value = (DAMAGE FORMULA);
}
</Damage Formula>

if you want to add other states(weaknesses), say, for example, if the enemy is weak against state X, Y, and Z, then just add the following to the 1st line of code:
if (target.isStateAffected(x) || target.isStateAffected(y) || target.isStateAffected(z)){
@Alisu I am trying to avoid that for balance issues because if the unit was say, weak to Fire weapons and was a Calvary unit, the result would be the foe taking an obscene amount of damage if hit by a Fire elemental weapon that was effective on Calvary units. That would also inversely mean any weapon in the Calvary element would do the boosted damage, not just that one weapon.

@Fernyfer775 I have everything but the Skill Core- I'll download it and try that in the morning when I can access my computer that has MV. EDIT:Wait, this is on a per weapon basis, so damage formulas wouldn't work here (stupid mistagged the post)...

EDIT 2: I'm going to go with @Alisu 's version, but limit the number of weapons with that element. I really don't need things like Fire or Light weapons in this particular game anyway, so that makes things easier for me.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/making-a-weapon-that-deals-more-damage-based-on-states.94038/