MV Yanfly Buffs and States Core Help

Hello, I want to set up a state that increases the specific element (in this example element id 1) damage by 25%.
I’m pretty bad at coding, so I asked ChatGPT to help me out and this is the code it came up with, but it doesn’t work 😀

<Custom React Effect>
if (this.item().damage.elementId === 1) {
value *= 1.25;
}
</Custom React Effect>

Any help is appreciated, thank you 🙂
I asked ChatGPT to help me out and this is the code it came up with, but it doesn’t work
It generally won't. AI generators, by definition, generate things - they make things up. That's why it's common knowledge that they can't correctly solve grade school math problems and make recipes with inedible ingredients.

In this specific case the code is so short and simple that it's basically correct, but I don't understand how it makes sense to ask something you know has flaws before asking people who actually know things.

Overall, your problem is that you're using the wrong notetag. You might want to review the chart in the Buffs & States Core instructions under Custom Action Effects to see which notetags are for the defender, which the attacker, and when they happen.

It's hard to offer any specific help because you don't explain in detail what this should do - if it's to make a target more vulnerable to an element, why not just use a Trait with an Element Rate?
Yep, code looks OK. However, I'd suggest you round value to ensure it's always an integer:
JavaScript:
if (this.item().damage.elementId === 1) {
  value = Math.round(value * 1.25);
}
From the plugin's documentation:
Action Connects as a Success Hit, skip if Missed or Evaded
- Attacker: Confirm
- Defender: React
I.e. use <Custom Confirm Effect> to multiply damage from the state bearer.

Alternatively, you could just use YEP_ElementCore, which has built-in tags for this kind of thing:
Yep, code looks OK. However, I'd suggest you round value to ensure it's always an integer:
JavaScript:
if (this.item().damage.elementId === 1) {
  value = Math.round(value * 1.25);
}
From the plugin's documentation:
​
I.e. use <Custom Confirm Effect> to multiply damage from the state bearer.

Alternatively, you could just use YEP_ElementCore, which has built-in tags for this kind of thing:
This works, thank you so much, I totally forgot about element core ;-;

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-buffs-and-states-core-help.174242/