Raising Parameters Temporarily

I know this is probably a bit of a silly question, but how do I make an item that raises a parameter temporarily? I want to make an item increase magic attack by +5 and have it wear off after a certain period of time.
....... using the item's own "apply state" action on use? 0o
if you want that, but without *using* the item, then it's going to be a little more complicated.
When I go to states I can only raise the parameters by a percentage and not a set amount. Also, I don't know how to make it where it can wear off with a certain amount of steps and in battle.
You can change the value to an integer if you edit the code, for which you'll need a plugin, or follow some instructions.
Not hard to do, tho.... but it can mess up things if there's another plugin counting on those percentages.
As for the wearing off,.... I believe you can link steps and in-battle turns... it's a feature.
(depends on the battle system, tho)
So can I check "remove after _____ steps" and use the "remove after battle turn" option? I don't have to choose one or the other?

Will it remove it after BOTH of those or whichever comes first?
if in battle, after X turns.
if out of battle, after X(steps_per_turn) steps.

I don't remember if they're interchangeable.
"remove after X steps" should take effect only when out of battle, unless there's a conversion back from steps_per_turn (I don't remember)
"after X turns" *can* take effect in and out of battle, because of the same reason.
So for example, if I have a state inflicted from an item on the menu, out of battle. The state is effective for 100 steps, the character walks 50 steps and gets into a battle- the state will persist into battle. That state also has the "State ends at turn 3-5". After 5 turns, the state is removed in battle, but will remain out of battle the remaining 50 steps for the character?
No, everything counts to the same total.
I just checked, walking on the map essentially triggers an in-battle end turn.
so, the valid thing is the turn count, and when you're not in battle, every X steps, the same function triggers to process what happens during one battle turn.
With that, you get regeneration, drains, and changes of states.

(And, also checked the conversion to integer,...... and it's not that easy. It can be done, but it's more messy than just changing one formula. You'll probably want a dedicated plugin for that.)
If you want states to change parameters by a set value instead of a percentage, look at my signature.
I wrote a plugin for that few months ago, it should be named flat stat states IIRC.

Original thread: https://forums.rpgmakerweb.com/threads/raising-parameters-temporarily.78801/