MV Checking a target's element rate through scripts or plugin commands?

It doesn't appear possible to check an actor or enemy's element rate(s) through scripts in base MV. With that being the case, I was wondering if anyone knew of a plugin or scripting workaround that would let me accomplish this!
no, it can be done in default by scripts.

the problem is that the element rate is one of the traits, and you have to reference a lot to find a specific trait because that list contains almost everything the actor/enemy can do, not only the element rates.

what exactly are you trying to do? with some details someone will be able to point you to the correct script code to find and access the data you want. It is just difficult to describe in general without a specific target.
no, it can be done in default by scripts.

the problem is that the element rate is one of the traits, and you have to reference a lot to find a specific trait because that list contains almost everything the actor/enemy can do, not only the element rates.

what exactly are you trying to do? with some details someone will be able to point you to the correct script code to find and access the data you want. It is just difficult to describe in general without a specific target.
What I'm currently trying to do is create combination attacks that deal different types of damage at different steps of the attack. For example:

Slash (physical), slash, slash, lightning spell

I imagine there are probably other ways to do this, but I've been using Yanfly's Action Sequence plugins for it. For the example attack I have the slashes function as the action's normal effect, and then call the spell as hp damage through a formula. However, I don't know how to apply the target's lightning rate to this method.

If there's a better alternative method for setting up these kinds of attacks (maybe forcing a separate action at the "spell" stage of the attack...?), that would also be equally welcome!
This gets the element rate of battler for element ID 5:

battler.elementRate(5)
A value of 1 means 100%.

That said, YEP Element Core adds some action sequences that can change the element mid-action:
It sounds like that would be an easier solution here?
This gets the element rate of battler for element ID 5:

battler.elementRate(5)

A value of 1 means 100%.

That said, YEP Element Core adds some action sequences that can change the element mid-action:
It sounds like that would be an easier solution here?
The main thing that confounds this solution is that the Element Core element-changing function only works on the action effect; that is, the formula for the skill as it appears in the built-in formula box. If I want to have one of the hits deal damage with a different formula within the same skill, the element-changing function doesn't apply.
Oh, I see. I imagine there are other options, but maybe you could use a switch (or variable) in the damage formula, e.g.

$gameSwitches.value(123) ? a.mat * 2 - b.mdf : a.atk * 4 - b.def * 2
I.e. "if switch 123 is on, return a.mat * 2 - b.mdf, else return a.atk * 4 - b.def * 2". Then you could toggle that switch on/off using action sequences, vaguely like this:

change switch 123: off action effect action effect change switch 123: on force element 5 action effect
This wouldn't change hit type or anything, though...not sure if that's relevant. 😴
Oh, I see. I imagine there are other options, but maybe you could use a switch (or variable) in the damage formula, e.g.

$gameSwitches.value(123) ? a.mat * 2 - b.mdf : a.atk * 4 - b.def * 2

I.e. "if switch 123 is on, return a.mat * 2 - b.mdf, else return a.atk * 4 - b.def * 2". Then you could toggle that switch on/off using action sequences, vaguely like this:

change switch 123: off action effect action effect change switch 123: on force element 5 action effect

This wouldn't change hit type or anything, though...not sure if that's relevant. 😴
Ah, I hadn't really considered doing it this way! I think I can apply this to some of my skill ideas and it should work. Combined with knowing how to call the target's element rate, you've covered my question pretty thoroughly.

Thank you kindly for the assistance!

Original thread: https://forums.rpgmakerweb.com/threads/checking-a-targets-element-rate-through-scripts-or-plugin-commands.146183/