Set Variable to Enemy's Spot in Database?

What I want to do is target an enemy, and have it return its spot in the database to me. For example: even if there are multiple bats, it will return the info that I targeted a bat at all.

I'd imagine I'd need to do this in a damage formula. But I don't know what that formula would be.

Thanks in advance.
If the skill only targets enemies, put (x variable id):
v[X]=b.enemy_id; a.atk * 4 - b.def * 2

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/set-variable-to-enemys-spot-in-database.177934/