Attacks of opportunity

I am trying to add attacks of opportunity to my game. I am using Yanfly's row formation plugin, and have added in range, reach, and melee zones. I have successfully created skills that will allow movement between the different zones. What I am trying to do is to add an attack of


opportunity when a character moves from range all the way to melee, or melee all the way to range without making the traditional 5 foot adjust out of threatened space. 


So, skills 265( melee to ranged) and 261(range to melee) need to grant the enemy a chance to attack the skill user. I looked into using a common event, it can force an enemy action, but I would need to duplicate skills 261 and 265 once for each character. Is there a 


<Custom something Efffect>?


Enemy.random.useSkill(260);


this.user


<\Custom whatever>


That I could use to make a random enemy attack with skill 260 (Attack of opportunity) against the character that uses skill 261 or 265? I sure that is completely wrong, but it should demonstrate enough intent to get my desire across. 
You surely will need the YEP Counter Control and Lunatic Mode for that, but that's as far I can help.

Original thread: https://forums.rpgmakerweb.com/threads/attacks-of-opportunity.61551/