Multiple Elements via Damage Formula?

Hi! Wondering if it's possible to create a skill using the damage formula box that incorporates more than one elemental type.

For example: 50 + (a.atk*5 - b.def*2) as FIRE ELEMENT damage plus 30 + (a.atk*6 - b.def*2) as ICE ELEMENT damage

I'm assuming it would require somehow tagging different parts of the damage formula with an element type, but not sure if this can be done. Thanks so much in advance
Not possible by damage formula alone as by default, the default element rate applies to the result of the formula.
Theoretically it might work inf you don't give an overal damage element and call the individual rates by code, but that would still be a very complex formula and not worth the effort.

instead, there are several plugins that allow you to handle multiple elements.
unfortunately I don't use MZ so can't point you to one, but I suspect that at least Visustella's element core has those options.
Without a plugin, you can set the skill to Element: None and do all the rate calculations manually. In the damage formula, b.elementRate(5) gets the target's damage rate for element 5.

E.g. if Fire is element 3, and Ice is element 4, then your example could be written as:

(50 + a.atk * 5 - b.def * 2) * b.elementRate(3) + (30 + a.atk * 6 - b.def * 2) * b.elementRate(4)
If you're already using plugins that change element mechanics, e.g. amplify user's fire damage, or check the skill element for display purposes, e.g. custom damage popups, then like Andar says you'll probably want a plugin.
I think you can, granted I am new to RPG maker, and my only experience is with MZ, but from what I understand, this is entirely possible with the built-in mechanics in the engine. You need to call elementRate(id) from the database within the damage formula.

elementRate(id): This is used to get the effectiveness of a specific element against the target. The id represents the elemental type, such as Fire, Ice, or Lightning, and it returns a multiplier based on the target's resistance or weakness to that element.

So
(a.mat * target.elementRate(3) * 0.5) + (a.mat * target.elementRate(4) * 0.5) would take 2 elements into account. Or at least in theory. Not at home to test this oput; anyone else can also chime in.
Not at home to test this oput; anyone else can also chime in.
Well...it's good that you want to help, but @caethyril had already chimed in with that information two hours before you posted this 😉

Also, the damage formula doesn't have any target variable, you have to use b.

(as a side note, it absolutely doesn't hurt anything if it makes it easier for you to read the formula, but the parentheses are extraneous - multiplication is all resolved before addition)
(as a side note, it absolutely doesn't hurt anything if it makes it easier for you to read the formula, but the parentheses are extraneous - multiplication is all resolved before addition)
@caethyril beat me to the punch!!! I guess I should have read past the 1st reply huh??

Yes!
a. + b. to select targets. Thank you for correcting me here.
(Technically target will work in the damage formula, but b is easier to write.)
(Technically target will work in the damage formula, but b is easier to write.)

1728391514127.png

😩

I retract the correction, @jerrylikesgreen.

Output: I mean, your post is still valid. Using a. + b. is better. Doing it the way I suggested is more work for nothing.
Honestly....
Based.

Original thread: https://forums.rpgmakerweb.com/threads/multiple-elements-via-damage-formula.172448/