MV Action Sequences - function for checking user's enemy index?

Hi there! I'm using Yanfly's Action Sequences and I'm just looking for a particular function that I can't find in any documentation I checked, which is checking the index of the enemy that used it so I can run one of two particular choices in the action sequences. Here's an example:

Code:
motion spell: user
action effect
if user.enemyId() == 0
  change variable 139 = 3
  change variable 140 = 0
else
  change variable 142 = 3
  change variable 143 = 0
end
common event: 52

I've tried using user.index(), user.id(), user.enemyId(), and user.enemyIndex() but none of them works. I've used the function for checking a player's index before, but never for an enemy's, and I can't find the function listed anywhere. I might also be getting my syntax wrong, but I don't know.
I don't see the relevance of the action sequence you posted to your question.

However, here's my favorite reference:

user.index() is the correct method, and it should work for both enemies and actors.

if user.enemyId() == 0
You know this can never be true? IDs in the database start at 1.
I don't see the relevance of the action sequence you posted to your question.
I basically have a skill where I change different sets of variables depending on which enemy on the field is using it.

However, here's my favorite reference:

user.index() is the correct method, and it should work for both enemies and actors.


You know this can never be true? IDs in the database start at 1.
Thank you, I'll bookmark this link. Your suggestion worked perfectly, thank you.

Original thread: https://forums.rpgmakerweb.com/threads/action-sequences-function-for-checking-users-enemy-index.150374/