Applying a state to enemies affected by (x) state with a skill

I am using Yanfly's action sequences plugin for this.

I am trying to make a skill that targets and hits all enemies for damage. And if, amongst those enemies, there is an enemy with a particular state, that enemy with the particular state suffers additional states (status effects). How would one go about implementing this in code/notetags?
<After Eval>
if (target.isStateAffected(x)) {
target.addState(y) }
</After Eval>
That worked perfectly. Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/applying-a-state-to-enemies-affected-by-x-state-with-a-skill.78578/