Closest event with specific event name note?

Hello everyone! What I need is a script that enable through a script call. The idea is that it will check what event is closest to it (it being another event) and has a certain name note tag. In my case <enemyX> (Where X is a number) and if it's within a certain range return it's Event_ID.

Any help greatly appreciated and of course I'll add you name to the project credits!

Cheers ^-^

Original thread: https://forums.rpgmakerweb.com/threads/closest-event-with-specific-event-name-note.44359/