More Damage Formula Questions

I am having problems on both sides of creating my ability.

So I have 2 parts to my skill.

1.After 5 turns that my actor does not have state X, add state X.

2.If my actor currently has state X use bonus damage formula and remove state, else use normal damage formula.

I cannot get either side of this to work through battle evens or damage formulas. Please help.

Edit: Also on another skill I would like to add a state to my actor if he attacks a enemy with a specific state.
I would suggest using a different logic to this and make it only appear to the player that everything works like your description.

1) Make an "wait for X state" that has no icon, no bonus and no effect on the player. That state would be invisible and it would appear as if the actor has no state active.

2) Use Tsukihime's progressive states to make the state X follow the wait state after 5 turns

http://himeworks.wordpress.com/2013/03/29/progressive-states/

3) Use an if-sequence in the damage formula to check for the state and choose the damage formula if it's there.

But if you remove that state X, you also add the wait-state to the actor, triggering the new wait cycle.

I bet your biggest problem with the damage formula is that the formula field needs the damage number last, you can't simply place the formula in the middle of an if statement.

It needs a structure like "If X; dmg=formula1;else;dmg=formula2;end; dmg" (that is not the correct syntax, only to show the structure for you to know how to make the correct formula)

If those tips don't help you solve it, please post the damage formula you're trying to implement, perhaps together with screenshots of state and skill
The only part i'm still having problems with is continuously applying the state. I'm not sure how to go about doing it. I can't seem to get it done with events. I want it to apply itself without initiation. Every 5 turns that it is not active.
The only part i'm still having problems with is continuously applying the state. I'm not sure how to go about doing it. I can't seem to get it done with events. I want it to apply itself without initiation. Every 5 turns that it is not active.
That is rather difficult, because you always need something to initiate an action on the computer. That something might be a background process watching a timer, but you need a trigger somehow in all cases.

Using a background event or a background script can cause lag or problems if you're not careful - that's why I suggested an invisible state for initiation.

What is your problem with that suggestion? Why can't you do it this way in your game?

And please post some more info on your current status - to help you with better specifics, we need to know what you've done so far.
Sorry maybe I am misunderstanding. I don't understand what applies the initial invisible state in your suggestion. So I don't have anything started on that end.

Original thread: https://forums.rpgmakerweb.com/threads/more-damage-formula-questions.17055/