How to check note tags of event

Is there a way to check an note tag of an event, determine if an <tree> is present there, and if so, trigger a conditional branch?

I imagine it'll require either a script or possibly even a plugin...

I'm trying to make a pseudo AI for chopping. My problem is... If it is a tree in front of a character it trigger an animation and get logs... But I need a script call for check events that has the <tree> note tag... so it only get "logs" (add +1 to a variable) if it is true.
Yes,
$dataMap.events[eventId].meta['your_notetag']

Code:
if ($dataMap.events[eventId].meta['your_notetag'] === 'blabla'){
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
Yes,
$dataMap.events[eventId].meta['your_notetag']

Code:
if ($dataMap.events[eventId].meta['your_notetag'] === 'blabla'){
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
Thanks! \(>w<)/
If your note tag is just <tree> I think you can also just do

Code:
if ($dataMap.events[eventId].meta['tree']) { do stuff }
Even of this thread is an old one, I might ask something

What would it look like if I wanted to check an events note tag on the event next to me? So if a <tree> is on tile next to actor, and I use an water item or skill to let the tree react to it?
Necro-post notice: @Prellmarc

Your question is not the same as the OP's so you are also hijacking. Please start your own thread for your question, and post a link to this one if you think it'll be useful.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-note-tags-of-event.124876/