Saving a notetag value to a variable

Hello guys, I have a doubt, been looking everywhere for a way to adapt this but I cannot seem to make it work.
So basically I want to assign a value to an enemy through a notetag, which will assign them an element, then during battle certains skills will check for the element on the notetag and depending on it there will be a different effect.

Example:
Monster: Slime
Notetag: <Element = 1> (which would mean, water for example)

So I want to read the notetag when a skill targets the slime, assign it to a variable and then decide the effect based on it.
Example: Hero1 casts Blizzard on slime, ice element on water enemy will cause it to be frozen.

Is there a way to achieve this?

Thanks in advance!
look into RegExp instructions.
it's possible, but depending on the scope of the solution it might serve you better to learn RegExp and make it yourself, than using a 3rd party plugin.
everything is possible, but the way to go at this depends on your entire plans.
for example in your description you ignore how the skill itself should read the notetag, and for more complex interactions you might have to use a custom script.

For now I suggest you look into tsukihime's conditional states and placeholder state scripts, perhaps even his target manager or damage core scripts - those should enable you to do most of what you describe - but they have some limitations.

If that is not enough, then most likely you need a custom script - either programming it yourself or asking someone to do this. But in that case you'll need a complete description including all possible elements and all possible interactions between them in your game.
@gstv87 I understand, looked into regexp but it's so hard to understand without examples, I've been struggling with RGSS3. Do you happen to have a guide that includes examples at hand? I would be very grateful.

@Andar I was used to RM2k3 so most things I do are using the game events and using some plugins, but I've been trying to thinker around scripting to no use. Is there a difference in performance if you use events or scripts?

Thanks for your responses.
Is there a difference in performance if you use events or scripts?
depends on what you use them for.
some things are easier to do as events, and some things are easier to do as scripts.

I gave you the names of tsukihime's scripts because I suspected that regex is too much for you. Let those scripts handle the regex part, as said they will allow you to handle most of your ideas, although they still need some programming knowledge to be used.
depends on what you use them for.
some things are easier to do as events, and some things are easier to do as scripts.

I gave you the names of tsukihime's scripts because I suspected that regex is too much for you. Let those scripts handle the regex part, as said they will allow you to handle most of your ideas, although they still need some programming knowledge to be used.
Understood, will take a look at them, thanks a lot.
regexp is a way of scanning for generic patterns.
for instance, to grab your tag.
Ruby:
note ~= /<Element\s*=\s*(\d+)>/

that reads as:
"from variable 'note', scan for this pattern: one lesser-than sign, followed by the string 'Element', followed by, if present, one or multiple empty spaces, followed by one equals sign, followed by, if present, one or multiple empty spaces, followed by one or many digits 0 to 9 which are to be saved, followed by one greater-than sign".

if you get to dominate the code, you can grab the values directly by providing the correct template to scan for it.... as opposed to, reading the whole note block and separating the tags and values by using loops and control structures, as it's often done.

Original thread: https://forums.rpgmakerweb.com/threads/saving-a-notetag-value-to-a-variable.138255/