Temporarily increase/ decrease Target's defense or offense using the Target's defense or offense.

If this seems familiar, it's because I made a post asking how I could temporarily increase/ decrease actor's defense or offense using numbers that I set instead of using the built in buff and de-buff system.

After a while of playtesting, I realized that these skills that increase/ decrease defense or offense become useless once the player gets to a certain point. So I'd like to make them instead use the target's defense or offense to calculate their added defense or offense.

I was also using Yanfly's Buffs and States Core and Auto Passive States because the solution I was given was to use those which worked.

This was the Solution.
<custom apply effect>
target.addParam(3, x); //x is amount of def to increase, 3 refers to numeric ID of param to change
</custom apply effect>

I tried changing x to a.def, def, and x% and it didn't work, so I'm pretty stumped and need help on this.
(No worries, I think they just accidentally posted in the wrong thread. Posts deleted.)

Does this work?

<custom apply effect> target.addParam(3, target.def); </custom apply effect>
If you want to reference the subject/user instead of the target, try user.def instead. Variable names depend on the context: notetags won't necessarily use the same names as the built-in damage formula.

Note that this will be permanent, unless you undo it when the state wears off or something.
(No worries, I think they just accidentally posted in the wrong thread. Posts deleted.)

Does this work?

<custom apply effect> target.addParam(3, target.def); </custom apply effect>

If you want to reference the subject/user instead of the target, try user.def instead. Variable names depend on the context: notetags won't necessarily use the same names as the built-in damage formula.

Note that this will be permanent, unless you undo it when the state wears off or something.
I'll try this out.

Edit: Works perfectly, thanks! Also, I figured out how to undo it so, no problem.
Great! Happy RPG Making~

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/temporarily-increase-decrease-targets-defense-or-offense-using-the-targets-defense-or-offense.152033/