MZ this.getItemElements is not a function?

I had some code from a few MV games I worked on that I threw into MZ. Normally that plan seems to work just fine... except not this time for some reason.

In essence, I have a passive state (via VisuMZ_1_SkillsStatesCore; used to apply it via YEP_BuffsStatesCore back in MV) applied to actors and enemies alike that checks through the elements of the skill in question (I typically apply two elements to every attack, though one is more "damage type" and isn't checked while the other is), and if the target is weak to one of the skill's elements, it applies a state. Except I can't make this happen if I can't check the skill's elements, and I can't check the skill's elements because apparently this.getItemElements() doesn't do anything anymore.

Anyone have any idea what's happening here? Is there a viable workaround? I'm very curious to know what the issue is, though my best guess is that this.getItemElements() is a Yanfly function or something that never carried over. Or got renamed?
several possibilities

1) a typo - which is why we ask for screenshots instead of retyping the message.
happened to everyone to write a function with a typo and then be blind to it and even write it correctly here in the forum.

2) the function is either renamed or does not exist in MZ - there is a reason why most MV plugins need FOSSIL to work ion MZ.

3) wrong context - try to use the full function name instead of the "this" shortcut.
Game_Action#getItemElements is defined in YEP Element Core. Normally an item can only have 1 element. You'd need the VisuStella equivalent, or (assuming you have the correct context) just check this.item().damage.elementId instead.
Game_Action#getItemElements is defined in YEP Element Core. Normally an item can only have 1 element. You'd need the VisuStella equivalent, or (assuming you have the correct context) just check this.item().damage.elementId instead.
A few questions about that.

1. would this.item().damage.elementId catch all the elements, or just the one mentioned in the default database? (ex: if the database element is element 4 but I also added element 1 via a notetag, would it catch both or only element 4?)

2. if the latter, would it still work right if the element in question is "Normal Attack"?

3. is there any way of knowing what the VisuStella equivalent is? YEP_ElementCore never mentions #getItemElements() anywhere in the help window, and VisuStella plugins are obfuscated, so just combing those probably won't work.

... and just as I finish typing all this out, I have an epiphany on how to look into it, and... I *think* this.elements() is the VisuStella equivalent. If nothing else, it isn't returning any errors. I'll look more into this function.

Edit: Yep, I'm... 95% certain this is the exact same function. Replacing this.getItemElements() with this.elements() seems to do what I need it to do. Well, hopefully this helps anyone else having my issue! lol
I don’t know if this will help but I do something similar with if(this.elements().contains(x)) to check multiple element skills
Nice! Answers for your other questions, in case it helps:
Spoiler: core script elements
  1. this.item().damage.elementId returns the Element setting for the corresponding Skill/Item in the database.

  2. Good point: it returns -1 for Normal Attack. In that case you can get the subject's current attack elements instead, e.g.
    JavaScript:
    // Get damage formula Element setting.
    const e   = this.item().damage.elementId;
    // Convert to array of element IDs.
    const ids = e < 0 ? this.subject().attackElements() : [e];
    attackElements returns an array of element IDs, e.g. [1], or [5, 2].
In your case it's best to stick with VisuStella's elements method.

Original thread: https://forums.rpgmakerweb.com/threads/this-getitemelements-is-not-a-function.166182/