Yanfly State Notetags

Hi All,

I am looking for an overview with Yanflys State notetags

For example
<Custom Confirm Effect>
<Custom Establish Effect>
<Custom Apply Effect>

Etc.

The reason why I'm asking is that I want to create a state where the user does 2x more damage with a specific skill type

I came up with the following
<Custom Establish Effect>
if (this.isSkill() && this.isHpEffect() && value > 0) {
var skillType = 1;
if (this.item().stypeId === skillType) {
if (this.isMagical()){
var originalResult = JsonEx.makeDeepCopy(target._result);
var extraDmg = Math.ceil(2 * originalResult.hpDamage);
target.gainHp(-extraDmg);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();

}
}
}
</Custom Establish Effect>

The extra damage is applied so that works, although, the state gets refreshed and doesn't get removed even if The auto removal timing is only on 1 turn.
I guess that it because of the notetag that I used.

Furthermore, the target doesn't seem to do the normal animation when someone takes damage.

Any input is appreciated.

Thanks
This "JsonEx.makeDeepCopy(target._result);" can be replaced by a simple command: target.result(). If you want to return target damage taken, use this better: target.result().hpDamage. And i think it does not work because in "Establish Effect", there is no such thing called value to represent damage dealt/taken.
For this kind of skill, i personally think about using "Confirm Effect", since it allows you to manipulate the damage before it is dealt to the target via value.

To understand better about Confirm and Establish effect, you should know this:
- Confirm Effect works before the damage is actually dealt to the target, so you can manipulate the damage via value.
- Establish Effect works right after the damage is dealt to the target, so you cannot manipulate the damage via value, but you can return the exact amount of damage dealt to the target through target.result().hpDamage (Including critical damage).

I think this might work:
Code:
<Custom Confirm Effect>
if (this.isMagical() && this.isSkill() && this.isHpEffect() && value > 0) {
var skillType = 1;
if (this.item().stypeId === skillType) {
value *= 2;
user.removeState(x); //change X to this state ID, as you want to remove it after you hit the target, right?
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();}
target.clearResult();}}
</Custom Confirm Effect>
Thank you, that indeed did the trick.

I'm trying to learn how to put stuff like this together, then it mostly consist out of copy and paste work from other sources and putting them together to get result I want and that's where the "JsonEx.makeDeepCopy(target._result);" came from.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-state-notetags.102543/