Fight to Progress

Is there a way I can detect if the previous action was to fight, as fighting is skill 0001? I want to progress the fight only if the player had fought, and I want to be able to use the variable it is stored in to have the speech only work when the player fought last turn. Thanks in advance.

Edit: I figured I might as well say that an example of what I mean is the Sans fight.
what exacly do you want to accomplish? using basic skill and learn more skills when x time is learned?
or a different way? Explain it in a bit more detail so you can recieve support answer.
Do you mean the previous action was to fight (i.e. there has been a battle before this one) or do you mean that the last action was Attack? Just checking because you used such an odd expression.

Assuming you mean Attack, in the damage formula of the skill, add v[#n]+=1; at the beginning. That is Ace syntax, but I think it is the same in MV
In your troop event run a conditional every turn, dependent on a particular global switch being OFF.
Nested conditional - Is variable [#n] equal to one?
If yes, run your dialogue and turn the global switch ON
If no, do nothing.
@AcousticJamm Using Yanfly's Skills Core, you can put notetags in Skill noteboxes. In your case, you would probably want to initialize two variables. For the sake of this example, let's go with #0001 OldAttack and #0002 NowAttack. Of course, you've probably long since used variables 1 & 2, so just substitute IDs you can use. Set both variables to 0. In the Attack skill's Note box, type the following:

<Post-Damage Eval>
if(target.isEnemy()) {
$gameVariables.setValue(2, ($gameVariables.getValue(2)+1));
}
</Post-Damage Eval>
See proper note in EDIT below.

This should add 1 to NowAttack if skill 1 (Attack) was specifically used this turn. At the start end of each turn starting with turn 2, 1, you can compare NowAttack to OldAttack. If NowAttack > OldAttack, you know Attack was used, so you proceed with the block of code for that case, else...other block of code for Attack not used. Note: In the code block where Attack was used, be sure to include a line to add 1 to OldAttack so that NowAttack needs to add 1 again in order to be greater than OldAttack on the next turn. I haven't tried this myself, so there may be something here needing tweaking, but based on my current understanding, if you try this, it should work. Give it a shot and report back, please. 🙂

EDIT: I set it up and had to make 2 adjustments...the note box should read:

<Pre-Damage Eval>
if(target.isEnemy()) {
$gameVariables.setValue(2, ($gameVariables.value(2)+1));
}
</Pre-Damage Eval>

Otherwise, this worked for me. Note: You have to set the tabs to run at end of turn 1, end of turn 2, etc. or nothing happens until after you select your next move (if you just set on turn 2, on turn 3, etc.), and because of this, I had to move up the Post-Damage Eval to a Pre-Damage Eval or it breaks.
Unfortunately, none of your approaches have worked for me. I could not figure out how to apply it.

what exacly do you want to accomplish? using basic skill and learn more skills when x time is learned?
or a different way? Explain it in a bit more detail so you can recieve support answer.

I'm sorry. What I mean is this:
If you fight (use skill 0001), the battle progresses, and the enemy says something.
If you don't fight, the enemy's previous turn repeats, and no speech is said.

Edit: Might as well say this, the enemy dodges your attacks.

Edit 2: I found out how to do it on my own using common events. Thanks for trying to help, anyways.

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/fight-to-progress.110210/