Skill Element Dependent on Weapon's

I think this may just be an issue of me not knowing the name of the function I want to call, BUT:

I would like to have skills that take the element of the weapon that is equipped by the user. I planned to do this by simply using a bunch of conditionals in the formula bar, but I realized I don't know any function (and have not found one) that adds an element rate in the formula bar. What I would like to do is something that would look like:

a.hasWeapons($dataWeapons[ExampleIceWeapon]) ? addElementRate(ice),a.atk*4 - b.def*2 : a.hasWeapons($dataWeapons[ExampleFireWeapon]) ? addElementRate(fire),a.atk*4 - b.def*2 : a.hasWeapons($dataWeapons[ExampleThunderWeapon]) ? addElementRate(thunder),a.atk*4 - b.def*2 : a.atk*4 - b.def*2

Is that the right approach? And if so how do you phrase the function that adds elements and how do the arguments look? Or is there a more straight forward approach that I have missed?

Thank you for your time and help!
The "Normal Attack" element already does this, or do you need a different formula depending on element?
Its as weremole said, if you want a skill to use the weapon element, you simply need to set the element of the skill to "Normal Attack Element"
Oh wow, I don't know how I never realized the normal attack element thing works for that. Thank you.

There are some skills which have an element, but I'd still like them to also add the element of the weapon. Is there a function that I can put in the bar that tells it to do "normal attack" element in addition to the element I specified above?

Original thread: https://forums.rpgmakerweb.com/threads/skill-element-dependent-on-weapons.107960/