Fear spell

I'm trying to come up with a way of creating a fear spell.  The effect would be cause a foe to run from battle.  I would like it to be reisitable, like a state, but I don't see any way to do it with the RMMV editor.  I am using Yanfly Engine, I think I could do it with the Action Sequence packs, but have no idea where to start.  Thanks in advance!!
I haven't looked into it myself,  But why not we examine what "fear" is? 


When a enemy flees from battle,  the enemy disappears.  Weather or not you receive XP from it is up to you,  but the same concept can be said about death.  When an enemy dies,  it also disappears from battle.  My suggestion is to look at how RMMV looks at death/Knockout.  So, go in the database editor, go to states and start there.  Weather or not this can be done within the editor,  I'm not sure yet but once I get off the commute train and... take an hour drive home... I can open up RMMV.
Use this

View attachment Escape's state.js
mrcopra, you did it again!  That works perfect.  Now, I just need to figure out how to add a message to the battle log saying that the enemy fled.  Thanks again!
add the message in state page 
Not sure what you mean.  Is there a notetag?  Or is it some code eval?
Never mind, I see what you mean.  Thanks!!

Original thread: https://forums.rpgmakerweb.com/threads/fear-spell.64857/