Can Skill effects vary by command used?

I have two questions summarized by the title:

Question 1: In the database, there are "Skill Types" that determine which menu the Skill appears under during battle, the ones you can use to give access to them to different classes and stuff (not the "Types" that factor into damage calculation). There is a plugin I found that allows you to assign multiple Skill Types to one Skill so it will show up under multiple menus.

>Is there any way to make one Skill have different effects based on which action you use to execute it?

This isn't high priority for me, as my workaround has been to just give the characters multiple Skills with the same name I've given separate effects manually (i.e., when learning one Skill you actually secretly learned four). But I was hoping this would simplify things in the Database, as well as allow me to give each Skill a cooldown so that if you use it one way, it's off-limits all other ways until the CD is finished. That said, Question 2 should provide some extra context for this.


Question 2: In my game, I'm planning to have four Skill Types we'll call A, B, C, and D. The player learns Skills, one example of which we'll call Fire +1/-1, and every Skill is available for use as all four Types. Using a Skill like Fire as Type A deals damage to both the user and target, and using it with B heals both the user and target, both based on the numbers shown (negative for damage, positive for healing). These were easily done with the YEP targeting plugin that gave me a Target: All option, and this was ideal because it applies the Type multipliers normally to each (like Fire, in this case) regardless of whether its damage or healing.

>Skill Type C is planned to damage the user and heal the target; D is planned to heal the user and damage the target.

How can I do this while still applying Type multipliers to each? These skills should work this way regardless of whether the "user" is an actor or an enemy in battle, as ideally these Skills will appear in enemy movepools as well. I only mention that because I've seen a lot of tech that uses checks like target.isactor etc. I'm also aware you can use commands like setHP after a normal damage calc, but these wouldn't apply the Type multipliers and would require copious if checks that look for the Traits on each target. Is my only option here a lot of complicated nesting code?

Now that I think about it, in the event I could configure my Skills like I ask in Question 1, I would probably still need to know how to do what I ask in Question 2, because Enemy units don't have access to Skill Types, only individual Skills. So unless I'm wrong about that, please feel free to focus more on Q2.

Thanks in advance. And sorry if I rambled too much. I try to give only the most necessary information, but... aha
I still think your best bet is to make multiple skills with the same name.

If you have multiple skills with the same name, Yanfly's Skill Cooldowns plugin has linked cooldowns, which you could use to make all copies of the skill with the same name go on cooldown whenever any of them are used.
But I was hoping this would simplify things in the Database, as well as allow me to give each Skill a cooldown so that if you use it one way, it's off-limits all other ways until the CD is finished.
youre able to make skills trigger the cooldown of other specific cooldowns as a part if the skill's execution if that helps. Ive never heard of something to do what the want the way you describe it, but it would be a nightmare to get it to work for enemies without making it completely random.

this is the line to trigger a cooldown.
Code:
user.setCooldown(skillId, turns);

if this is a system youll be using for many skills, then you can have a notetag that looks like this
Code:
<After Eval>
var group = [11,12,13,14];
group.forEach(spell => user.setCooldown(spell, 5));
</After Eval>
and have all the related skill ids inside that group array.

Theres other ways to handle it like using their positions within the database to automatically trigger the other skills's cooldowns, but that all would require specific grouping inside of your database to make work and could be more work than its worth depending on how your database looks right now
Okay, really promising start! I tested the After Eval code offered
<After Eval>
var group = [11,12,13,14];
group.forEach(spell => user.setCooldown(spell, 2));
</After Eval>
and the Skills are going on cooldown for 2 turns as a shared group as intended! Also you would not believe this, but my Skills were actually in ID 11, 12, 13, and 14 lol. How did you know?
Spoiler: spoiler
Screenshot 2023-11-26 190404.png

They could probably share names too, so idk if maybe what Aphotic mentioned could be used?

That said, it works more correctly for the player than for the enemies right now, and I'm not quite sure why. I gave the test enemy the same Skills in the Database that I'm using (11 and 12, aka Types A and B from my OP) - but while my Skills show a cooldown of 2 starting from the next turn, the enemies always seem to have theirs available again after only 1. What I mean is they can Skill > Pass > Skill. My player would have to Skill > Pass > Pass > Skill, the correct outcome. Is it perhaps ticking their cooldowns at the end of the round the Skill is being used, but not mine?

Theres other ways to handle it like using their positions within the database to automatically trigger the other skills's cooldowns, but that all would require specific grouping inside of your database to make work
I don't have that many Skills in yet, actually just the basic four I've been using for testing. It didn't seem sensible to make more entries if I can't even get a template for the Skills working as planned, after which I'll probably just copy + paste + tweak as needed. So if you'd oblige, I'd be interested to know more about this and could likely tailor my DB for it from there.
and the Skills are going on cooldown for 2 turns as a shared group as intended! Also you would not believe this, but my Skills were actually in ID 11, 12, 13, and 14 lol. How did you know?
im 100% a psychic. pay no attention to the man behind the curtain.

They could probably share names too, so idk if maybe what Aphotic mentioned could be used?
its possible to do the checks by name, but I feel like itll be a bit better for the player if they had different names. Since enemies will also have skills like these, the player should be given as clear information as possible in regards to what's happening.

What I mean is they can Skill > Pass > Skill. My player would have to Skill > Pass > Pass > Skill, the correct outcome. Is it perhaps ticking their cooldowns at the end of the round the Skill is being used, but not mine?
that's odd. AFAIK, the enemy has the correct order of events here. a skill with a cooldown of 2 turns should be usable every other turn, and the enemy should be subject to the same rules as the actor. ill have to check this when i get the chance. Granted, I do use STB. so the input phase im used to using is after the start of the round, which might be when cooldowns tick. Someone else may be able to confirm that


So if you'd oblige, I'd be interested to know more about this and could likely tailor my DB for it from there
Certainly. since youre already using 11-14, ill start there.
Code:
<After Eval>
var group = item.id-((item.id-3)%4);

for (var i = group; i < group+4; i++)
    user.setCooldown(i, 2);
</After Eval>
that change will make it so that every "group" is every set of 4 skills after id #2. which means 11-14, 15-18, 19-22... 103-106 and so on are groups the way thats written. so as long as your skills are together in the same "group" that alone will trigger a cooldown on all of them without you having to define manually what a group is yourself
I do use STB. so the input phase im used to using is after the start of the round, which might be when cooldowns tick
That's a good point I forgot to specify in my OP - I'm using the default Front-View battle system, although with some YEP plugins as already came up. I don't think any of them would have changed when CDs tick, but I can't be 100% sure - I'm pretty new to all of this. And checking over their Wiki page for the Skill Cooldowns plugin, I don't think they specify when ticks occur either, other than saying "each turn."
The first would be simply waiting. Each turn in battle causes a cooldown to
drop by 1 turn. Skills and the such can be used to speed up this process.
I assume the last part refers to how Skills can be configured to lengthen or reduce other CDs as an added effect, not simply that using any Skill does so by default.

Spoiler: spoiler
Screenshot 2023-11-26 225651.png


As for the grouping CDs, it worked for the player same as before, and had the same inconsistency when used by enemies as well. I guess my question is, does this setup extend indefinitely through the whole Database? If I ever needed to add Skills that fell outside of this restriction, would I be able to do so?

And is the benefit of this method simply avoiding having to specifically enter Skill IDs? I can see how that would be nice the more Skills there end up being. Presently I've decided on 32 Skills (aka like "Fire" in the OP), which multiplies out to 108 given how I'm having to implement them across the four ABCD effect Types.
I assume the last part refers to how Skills can be configured to lengthen or reduce other CDs as an added effect, not simply that using any Skill does so by default.
yeah, its possible to have skills reduce the cooldowns of other skills. thats what that refers to. I had looked into the code and was able to see that it is as i thought previously. CDs tick at the start of the turn. IMO It'll be safer and easier to just make enemies get an extra turn cooldown or making players get one turn less when using skills than to change the tick to the end of the turn but someone else may have a better idea.
I guess my question is, does this setup extend indefinitely through the whole Database? If I ever needed to add Skills that fell outside of this restriction, would I be able to do so?
you can. I said what the groups are, but theyre not a hard coded restriction of any kind. the skills themselves are the only thing that enforce it, and they only impact whats immediately within their "group".
you could very well only use the code above as is for skills 11-14, then make another set of 4 for 20-23 instead of 18-21 by changing the math(its just removing the "-3"), and then later on decide that you want to use 83, 77, 38, 119 in a group by doing the first version. none of them would interfere with eachother provided that if you start to use an automatic group, you reserve those 4 slots for that group. (eg. you use the automatic grouping i gave earlier to make skill 20. skills 19, 21, and 22 will go on CD, even if you made a manual group of 33, *19*, 48, 11). the only difference is that you wouldnt be giving each skill a predefined list of grouped skills. and should you stick to one automatic convention, you wouldnt ever have to change anything.
And is the benefit of this method simply avoiding having to specifically enter Skill IDs?
Yep. Itll save you the need to put in all 432 ids between all 108 skills, remove human error incase down the line you accidentally put in a wrong id somewhere, AND itll also save you time if for any reason you have to reorganize skills.
if you hardcode 11-14 to be a group like in the first example, then if for any reason you have to move any number of these skills, youd have to readjustthe IDs in all 4 skills in the group. but, if you make the grouping automatic through what i did or any other similar means, then all you have to do is move the skills to another group that aligns. if you copy paste those skills to 91-93 for example, theyd still trigger eachother's cooldowns without you doing anything.
CDs tick at the start of the turn
Interesting. So then is this discrepancy caused by the player making their selection before the actual start of the second turn (before the CD has a chance to tick, enabling the skill), and the enemy choosing their Skill during the turn (after the tick enables it again)? That would make sense to me, although it is inconvenient.

IMO It'll be safer and easier to just make enemies get an extra turn cooldown or making players get one turn less when using skills
I agree, it seems like there are no immediate solutions to this. It was just a whim anyway, to try and make what the enemy can do feel logical and consistent with what the player is capable of, for strategizing during battle. It's possible I'll make second copies of all the Skills with no CDs for enemy use, because they're likely going to have access to fewer options total than the player, although at that point I could just alter the CDs specifically for the enemy... Well, no matter what I end up deciding it's a long way off.

theyre not a hard coded restriction of any kind. the skills themselves are the only thing that enforce it, and they only impact whats immediately within their "group"
Okay, I think... I mostly get it. One method is to directly reference Skills by their ID, and the other method uses math calculated off the selected Skill's ID to apply the CDs to a range. Neither of them actually changes anything about the Database or applies any overarching "rules" to it.

Still makes me feel like I have a lot to learn. Especially because I got my wires crossed and didn't even reference the correct number originally; 108 was unrelated (my estimated number of maps I'll need). 128 would be the number of Skills, lol. And that will be higher if I do end up having to make versions with altered or removed CDs.

This has been a very helpful thread so far. Thanks again. Though I still have a lot of experimenting to do if I'm going to get Types C and D working. I might have to swap those to single-target Damage and Heal instead if I can't... Wouldn't be the end of the world at this stage in the project.
I agree, it seems like there are no immediate solutions to this. It was just a whim anyway, to try and make what the enemy can do feel logical and consistent with what the player is capable of, for strategizing during battle
its actually a minor adjustment alter the CD if its an enemy or a the player. its just going to have to be present in all of your skills. ill take the last bit of code i put here to show it.
Code:
<After Eval>
var turns = 2; //new turn variable
if (user.isEnemy()) turns++; //increase turn variable is the user is an enemy

var group = item.id-((item.id-3)%4);
for (var i = group; i < group+4; i++)
    user.setCooldown(i, turns); //set the skill's CD to the turn variable
</After Eval>
thatll add an extra turn of cooldown to the enemy if they were to use the skill, and now itll appear as if the enemy has the same CD as the player for the same skills. you could also do the opposite, change Enemy to Actor, and decrement turns instead of incrementing it. Whatever you'd prefer doing, if you choose to do it.
Okay, I think... I mostly get it. One method is to directly reference Skills by their ID, and the other method uses math calculated off the selected Skill's ID to apply the CDs to a range. Neither of them actually changes anything about the Database or applies any overarching "rules" to it.
you understood it, and then explained it better than i could

And that will be higher if I do end up having to make versions with altered or removed CDs
you could add some bits of code into the skills themselves to alter the cooldowns for you instead of duplicating skills. i showed how to make enemies have an extra turn, but you could add conditions and comparisons to make them different. if you wanted enemies to not have cooldowns, you could have the line where you set the cooldown subject to a conditional that says that ill only run if the user is an actor instead of cloning the skill.
It is a learning process, but theres no shortage of tutorials on JS, what you can do with it, and what's relevant to MV. Its just a matter of figuring out what you *should* do and *how* to do it. If you want ideas, taking a browse through yanfly's tips and tricks section on their website can give you a good feel for different things you can do

This has been a very helpful thread so far. Thanks again. Though I still have a lot of experimenting to do if I'm going to get Types C and D working. I might have to swap those to single-target Damage and Heal instead if I can't... Wouldn't be the end of the world at this stage in the project.
by your description of them earlier, they didnt sound difficult implement. HP drain is already a thing the editor provides, and youre also already using the skill core plugin, so skills that damage while healing and heal while damaging are easy things to do.
Or is the uncertainty more about the concept rather than the execution?
HP drain is already a thing the editor provides, and youre also already using the skill core plugin, so skills that damage while healing and heal while damaging are easy things to do.
is the uncertainty more about the concept rather than the execution?
So, mostly it's about figuring out the right commands. In places like the Wiki coverage about YEP plugins, they (understandably) cover the new functions added by plugins, rather than basic functions used in the game's original code. I'm not afraid to mess around with stuff when I can in the name of experimentation, but I haven't got a great foothold on Javascript stuff the game could already do even before plugins, other than a thread I found that explains how all the different Event options translate into JS script (and none of those are options like "deal damage," having instead things like "setHP" and etc).

HP Drain isn't exactly what I'm looking for, although I did notice it was there. The Damage and Heal should be configurable as separate values with no need for them to influence each other - I guess another way to think about them would be like two Skills that happen at the same time, or within the duration of one character's "action" during combat. There don't actually need to be any calculations, either, as my working version of this battle system uses flat, fixed numbers for everything (like in the Fire +1/-1 example).

The most important thing is Type multipliers - if the Player uses a C action of a type they are immune to and the enemy is weak to, I need the game to know to use those for each effect. In this specific case, the player would take no damage, and the enemy would receive double healing (0, and 2). I already experimented with a D type Skill by making it target the enemy, deal damage like normal, and then resolve a setHP command on the user, but to include Types in something like that would require a bunch of checks for actor Traits for each Type before applying the "heal."

I believe that it is relatively simple to do - I tried to keep most of my ideas on the simpler side because I wanted to focus on a project that felt achievable rather than ambitious. I just don't know how exactly to do it, because I'm so inexperienced (this forum has been a wonderful resource, though!)

Also - I know I haven't explained the battle system all that thoroughly, but basically battles last for a specific number of turns, and both sides start with their HP in the middle of their total amount. Rather than defeating the enemy or being defeated, neither character can die, and the player's goal is to reach one of a couple different combinations by moving HP bars to a relative positive or negative position within the turn limit. All of this has already been implemented successfully on a small scale I believe will scale without problems.
but I haven't got a great foothold on Javascript stuff the game could already do even before plugins, other than a thread I found that explains how all the different Event options translate into JS script (and none of those are options like "deal damage," having instead things like "setHP" and etc).
ill assume youre talking about this one? yeah, there is no "do damage" function. what it is is that theres a gainHp() function that you give a negative value to to deal damage with. its not very clear that thats how its done by the engine unless you go into your project's js files and look at how damage is dealt (even gainHp() is basically setHp(), but it looks at the battlers current hp and does the math of how much hp they should have afterwards when they take the "damage").

However, thats also why i recommended looking at some of yanfly's tips and tricks. youll see proper uses of the functions and get a better idea of what you can do and how to do it. theyre usually also commented line by line so that you understand whats happening at every part of the code. for example in this one, its a state to reflect damage back to the attacker. if you look, youll notice that in order to deal the damage, it calculates the damage, turns it negative, and runs gainHp(). itd seem odd at first, sure. But after seeing more of the tricks use that method to deal damage, you'd get the idea that thats how you deal damage.

The Damage and Heal should be configurable as separate values with no need for them to influence each other
I see now that HP drain wouldnt work, but its still doable with the skill core plugin. youd make the skill an enemy damaging skill, and have the formula bot take care of the damage.
Then youd use the <Post-Damage Eval> tag provided by the same plugin, have some separate formula that makes reference to the user.elementRate(that element's ID) to calculate how much should be healed from that element, and then run user.gainHp(whatever the result is) to make them independent effects of the same skill. Now youll have an elemental skill that will deal damage to an enemy and respect their element rate while healing the user with respect to their own element rate.

Its a learning curve, especially if youre unfamiliar with JS or coding in general. But you probably have no real deadline. you take the time to look at guides and resources at your own pace and try to work things out.
this website has the objects and methods MV has by default organized in a way that i find helpful. so if you wanted to see all the things you could do to an actor for example, you can go to Game_Actor and see all the methods you can call and all the properties thats associated to an actor and then use them for your project. Not all of them have descriptions, but for most that dont, the name should be enough to tell what its for
theres a gainHp() function that you give a negative value to to deal damage with. its not very clear that thats how its done by the engine unless you go into your project's js files and look at how damage is dealt
Ohh, I never would have guessed that. I figured at some point looking into the game's default configuration would give me some ideas, but you've taken a lot of the guesswork out of that process for me. Probably would've been like trying to find a needle in a haystack at first.

theyre usually also commented line by line so that you understand whats happening at every part of the code. for example in this one, its a state to reflect damage back to the attacker. if you look, youll notice that in order to deal the damage, it calculates the damage, turns it negative, and runs gainHp()
You're right, the commenting is really helpful. I'd noticed they had tips & tricks on the pages for various plugins I was browsing, but unless they sounded in line with what I was trying to implement myself, I didn't check them out - pretty shortsighted of me.

youd use the <Post-Damage Eval> tag provided by the same plugin, have some separate formula that makes reference to the user.elementRate(that element's ID) to calculate how much should be healed from that element, and then run user.gainHp(whatever the result is) to make them independent effects of the same skill
Okay, that was what I had initially thought - something like an If check that heals for more if the elementRate is found, for the normal amount if not, and for nothing if the Rate is 0%. I was hopeful there might be an "easier" or simpler way, but in the end, sometimes you just have to do things the thorough way. Although given how simple my Skills' damage values and everything are, I guess it'll still be easier than it could become in a much more complex project.

Thanks for the tip about the reference site, too. This thread has really helped me get my ideas sorted out. You'd be right I have no deadline for anything, obviously, but I'm kind of a measure-twice type; I didn't want to become too attached to any plan or idea for my project if I wasn't confident early on I'd be capable of implementing it. Now I'm feeling a lot better about my chances!
something like an If check that heals for more if the elementRate is found, for the normal amount if not, and for nothing if the Rate is 0%
you wouldnt have to actually. that method returns the decimal representation of the battler's element rate directly. you'd just have to multiply your formula's end result by it. if their rate is more than 100%, theyll heal more, if its under 100% theyll heal less, and if the user's immune to the element itll have no affect.

Now I'm feeling a lot better about my chances!
Good luck on the project. Im glad youre feeling better about it now. Once you see some guides and play around with the engine some more you know where to ask if something has you stuck
I've just finished testing everything covered in this thread and it's all working perfectly! I gave the moves to enemies, tested all the values with a Player/Enemy who resist/are weak to the Type... everything's exactly right.
The notetags for each Skill type turned out combining everything like this:

Spoiler: type a+b
type A+B.png
Spoiler: type c
type C.png
Spoiler: type d
type D.png


The only other thing covered in this thread would be "copy-paste-proofing" the code even further. By that I mean I can identify two pieces which still require manual editing:
  1. the initial value of the cdturns variable for any given Skill is meant to be the sum of the absolute values of the two digits used by the Skill (example: Lightning +2/-1 would be a CD of 3)
  2. the call for user.elementRate would be optimized if there was some way to call and store the assigned Type for the Skill into a variable, then use that variable in the place of the user.elementRate(IDinput).
But I don't know if either of those are possible (especially the first one), and honestly with how well everything already works, I'm not complaining any. This has been a huge step forward for my project. I basically have the entire framework for my battles ready to go!
the call for user.elementRate would be optimized if there was some way to call and store the assigned Type for the Skill into a variable, then use that variable in the place of the user.elementRate(IDinput).
I don't see why you'd need a variable for anything. It's one of the properties of the skill, so you just use it.
Code:
user.elementRate(item.stypeId)

I haven't read this entire thread, there's a lot of text going on...what's the purpose of user.gainHp(1*type) ? 1 times anything is always just that number, e.g. user.gainHp(type)

But you may run into some problems with that - that's why you might want to avoid over-using variables, and putting them apart from where they're used.

You're setting type (and only using it once, so it's not really necessary?) to the result of elementRate(), which may be a decimal value. Trying to manipulate HP by a decimal value can cause weird glitches.

I've looked at your post #12, and I'm thinking maybe the 1 is a placeholder value? But regardless, you want to make sure you put that through a function to round it to an integer. e.g.
Code:
user.gainHp(Math.round(150 * user.elementRate(item.stypeId)));
the initial value of the cdturns variable for any given Skill is meant to be the sum of the absolute values of the two digits used by the Skill (example: Lightning +2/-1 would be a CD of 3)
assuming that youre going to keep that naming scheme where the positive number is first, theres a slash or some other non '+' character separating them, and neither number in the name will be more than a single digit, you can use this to read the name and add the numbers together
Code:
var sName = item.name.split('+')[1];
var cdturns = parseInt(sName.substring(0,1)) + parseInt(sName.substring(3,4));

the call for user.elementRate would be optimized if there was some way to call and store the assigned Type for the Skill into a variable, then use that variable in the place of the user.elementRate(IDinput).
assuming you wanted A = 1, B = 2, C =3 , D=4 or something sequential like that? use item.stypeId to get the skill's current skill type id and then adjust the value so that it fits your format for it. im also assuming that those skilltypes are also sequential in that order as well.

EDIT: Turan brings up a very important point i forgot to mention. unless youre giving gainHp a value that cannot be anything other than an integer, you should use Math.round(), Math.ceil(), Math.floor(), or some other means to round it to an integer. weird things happen if you dont.
I don't see why you'd need a variable for anything. It's one of the properties of the skill, so you just use it.
Geez, I feel like an idiot. I keep getting my terminology all jumbled, and I went and looked at the Database again... I have no idea why I've been using "Type" for "Element" other than maybe too much Pokemon on the brain. So, instead of calling the Skill Type ID, what I was hoping to do was call the Element ID of the Skill inside the user.elementRate(). That would make it so this code works in every Skill without my having to specify the Element it's checking for on an individual basis, and then use that Element's multiplier in the calc. Sorry about that!

And having a quick look through the reference Robro showed me, it doesn't look like Element ID is an option, unless...?
Spoiler: reference
Screenshot 2023-11-28 055117.png


I haven't read this entire thread, there's a lot of text going on...what's the purpose of user.gainHp(1*type) ? 1 times anything is always just that number, e.g. user.gainHp(type)
Can't blame you for that one. Although you're correct in the case of Skills using 1 here, I thought it would feel more consistent to use this formatting because other Skills will instead use values like 2, 3, or 4, and I'd probably be copy+pasting this when I make all the other Skills. I don't have any plans to use values higher or lower than 1, 2, 3, and 4, but I can see the wisdom in future-proofing work done now for any unexpected adjustments that could come in the future, so thanks for the tips there.

Trying to manipulate HP by a decimal value can cause weird glitches.
I actually tested this once, applying a 0.5 elementRate multiplier to 1 point of damage, and IIRC it didn't do anything. So yeah, that is weird. Much like the fixed damage/heal values though, my plan is to only use 200% and 0% (as well as not having any rate set), which I assume return as like 2.0 and 0.0 when used with elementRate? I don't foresee any rounding needed. And thankfully, I can always come back to this thread if that changes.

If I'm getting everything, the code should instead read:
Code:
user.gainHp(user.elementRate(skill's element ID));
for Skills applying a 1-point heal during this after eval, and:
Code:
user.gainHp(X * user.elementRate(skill's element ID));
etc for Skills where the heal is a higher number X

I tested it, and you were right, not having the 1* does result in the same thing. I suppose that means not having an Element Rate Trait in place at all returns 1.0 as the value for that.

assuming that youre going to keep that naming scheme where the positive number is first, theres a slash or some other non '+' character separating them, and neither number in the name will be more than a single digit, you can use this to read the name and add the numbers together
Woah. Sounds like the kind of thing I could easily break if I forget about the conditions too far down the line, but even the idea it's possible is really impressive. I am only planning to use single-digit numbers, so I'll give it a try. Thanks!
And having a quick look through the reference Robro showed me, it doesn't look like Element ID is an option, unless...?
youre on the right track. the damage property is an object that contains the element id of the skill amongst other things. so item.damage.elementId will get you your skill's elemental id. additionally, if youre using yanfly's element core plugin, it has a getItemElements() method to return the elements in a skill (and if you are using that plugin, you should use the method)
1701175372747.png
1701175415082.png


Sounds like the kind of thing I could easily break if I forget about the conditions too far down the line
if you keep the naming convention the same it should be fine. the code only looks at the skill's name, looks for the first '+', and then adds together the first and fourth characters after that. even if you have skills thatll be different, you can choose to not use this for those skills and put in the values yourself or make a change to what was provided to fit what you'll need.

Original thread: https://forums.rpgmakerweb.com/threads/can-skill-effects-vary-by-command-used.163287/