State to increase a specific Element's Damage

I use RPG Maker MV

Is it possible to create a state that increase the next fire damage spell by a certain percentage?

I thought Element Rate did it, but I think that is for defense only?

Also, is it possible to cast a spell on my warrior, like fire sword, to make his physical attacks do fire damage instead?

Thanks!
Both are possible without plugins, but the first is complicated.
To do the second, make a new state (Fire Aspect). In the state, add the feature "Attack Element: Fire". Adjust how long you want it to stick around and make a skill gift that state to someone.
For the first, make a state (Fire Bonus) that does nothing but stick around indefinitely. In every skill that is fire-elemental, in the damage line, have it check to see if the user has the element (with a.isStateAffected(stateId)), then if so, remove it and do more damage. See the link below for more help with the damage line.
http://www.rpgmakercentral.com/topic/36290-damage-formulas-101-mv-edition/
For your first problem, i have a way to do this, but requires a plugin called Yanfly's Buffs & States Core. If you are using it, create your state which increases your Fire Damage and add the note tag below to its note box:

Code:
<Custom Confirm Effect>
var elements = this.getItemElements(); //Get all elements from the current action
var fireId = 2; //Change this to your Fire Element ID in your database. By default, it is 2
if (elements.contains(fireId)){ //Check if current action contains Fire Element
var rate = 0.25; //Define the bonus damage rate (0.25 means 25%)
value += Math.ceil(value * rate);} //Increase damage dealt. "value" is the amount of damage dealt by your skill.
</Custom Confirm Effect>

<Custom Action End Effect>
target.removeState(x); //Change X to THIS state ID to remove it once your action is finished
</Custom Action End Effect>
If you haven't tried this plugin yet, i highly recommend you to try because it is a great help to create lots of complex states which can't be done via default system.

For the second one, kirbwarrior mentioned aboved.
I got the Fire Sword skill working, thanks Kirbwarrior.

Although, I am having trouble with the second using the recommended plugin.
I downloaded, Yan's Buffs and States Core, and installed it under his Battle Engine Core.

My Fire Element is ID 2
I want a 50% increase
And the state ID is 13

Was I supposed to make a change in the parenthesis to this line?
"var elements = this.getItemElements(); //Get all elements from the current action"

Here is what I have in the notetag, and it is not working.
Are there any other adjustments that you can see that I need to make?

Thanks for any help.



<Custom Confirm Effect>

var elements = this.getItemElements();

var fireId = 2;

if (elements.contains(fireId)){

var rate = 0.5;

value += Math.ceil(value * rate);}

</Custom Confirm Effect>



<Custom Action End Effect>

target.removeState(13);

</Custom Action End Effect>
Why did you know it was not working? I mean by doing that way, the bonus damage is added to the based damage before the damage is actually dealt, and there will be no pop up to say your target suffers more damage like you do with Element Rate unless you do it manually. I tested the state and it worked well. You can try to increase the rate (like 100 or 1000) to see the different in damage dealt. And don't forget to add Fire Element to your weapon (or armor, class, actor, etc) trait.
Here is the error I am getting:

CUSTOM STATE 13 CODE ERROR
YEP_BuffsStatesCore.js:2182 var elements = this.getItemElements();
var fireId = 2;
if (elements.contains(fireId)){
var rate = 0.5;
value += Math.ceil(value * rate);}

YEP_BuffsStatesCore.js:2183 TypeError: undefined is not a function {stack: (...), message: "undefined is not a function"}
Your formula didn't work for me, I changed it to this for testing;

Code:
<Custom Confirm Effect>

var elements = this.getItemElements();

var fireId = 2;

if (elements.contains(fireId)){

var rate = 10; //Change this to something more suitable like 0.5, 10 was to make sure it was working

value += Math.ceil(value * rate);

user.removeState(11);} //This was affecting the target instead of the user, I also moved it up here since Action End was giving weird errors, my state was 11

</Custom Confirm Effect>
I can't seem to understand what causes that error. I copied/pasted your note tags to my project and it worked very well. There is nothing you have to do before gathering all elements from your current action via "this.getItemElements()", just it alone is enough.
I usually get "undefined is not a function" error when i have a syntax error in my codes. You might want to check it again. By the way, can i see the your console log picture when the error occurs? Maybe i can find out what causes this.

Your formula didn't work for me, I changed it to this for testing;

Code:
<Custom Confirm Effect>
var elements = this.getItemElements();
var fireId = 2;
if (elements.contains(fireId)){
var rate = 10; //Change this to something more suitable like 0.5, 10 was to make sure it was working
value += Math.ceil(value * rate);
user.removeState(11);} //This was affecting the target instead of the user, I also moved it up here since Action End was giving weird errors, my state was 11
</Custom Confirm Effect>

By moving the "removeState" into Confirm Effect, if your action deals damage to your target more than once, only the first hit will have the bonus damage, then the state is removed.

I also have a Frozen state which will be dispelled when taking Fire damage:
Code:
<Custom React Effect>
var elements = this.getItemElements();
var fireId = 2;
if (elements.contains(fireId)){
target.startAnimation(133);
target.removeState(430);}
</Custom React Effect>
Here is what exactly what i do to my state for testing purpose, and it is working. Try to take it to your project and see if it works there.
Code:
<Custom Confirm Effect>
var elements = this.getItemElements();
var fireId = 2;
if (elements.contains(fireId)){
var rate = 100;
value += Math.ceil(value * rate);}
</Custom Confirm Effect>

<Custom Action End Effect>
target.removeState(28);
</Custom Action End Effect>
Remember to change "28" to your state ID.
I am probably doing something wrong besides the notetag..

I also tried using both the notetags from kirbwarrior and it still doesn't work.

I have the plugin console on boot, and the error I posted before was the entirety of the error message in that console. Is that what you mean by "console picture log?"

I'll try to explain everything I did since I may have a stupid mistake elsewhere.

My goal is to create 2 abilities;
1. When I cast Fire magic, the next wind or water spell is buffed.
2. An AOE fire spell that gives everyone in the party Fire Sword and buffs fire damage by 50% for the party.

With the advise in this thread, I got the fire sword working with an AOE fire spell, but the fire damage buff isn't working.

I have created a new spell entirely that gives my fire buff state to one person, to try to make sure it works before incorporating into the spell I want.


So here is what I did:

I created a trait that has;
no restrictions
no overlays
it is removed at the end of battle
auto-removal timing: Action End with 5 ~ 5 duration in turns
I added a message to sat (Target Name) Gains the Buff!!
I have no traits.
In the notes: I have tried what I copied into a previous post, and the following 2 suggestions.

I created a skill that has;
Black Magic: so my mage can use it
0 MP 0 TP
Scope is 1 ally
Occasion is Battle Screen
I changed nothing in Invocation
Message: I added casts %1!
No rewuired weapons
No damage
Effects: Add State - the state I previously made at 100%
Note: none

The skill I use to use if it worked is Fire, black magic, and I set the damage to fire element and it does 50 flat damage with no variance so I can be sure if there's any increase.
@JamesRyan That code you posted is still removing the state immediately (if I'm using it on the user), and removes it regardless of whether I used a Fire skill. I'm not sure how to make it remove it only with Fire skills.
@JamesRyan That code you posted is still removing the state immediately (if I'm using it on the user), and removes it regardless of whether I used a Fire skill. I'm not sure how to make it remove it only with Fire skills.
It is removed immediately on the user himself because once the user finishes his action (here is casting the skill with this state), the Action End Effect works and removes the state. I have a way to make it remove only after you deal Fire Damage. Just add some more pieces of codes.
Code:
<Custom Apply Effect>
target._checkFireDmg = target._checkFireDmg || 0;
</Custom Apply Effect>

<Custom Confirm Effect>
var elements = this.getItemElements();
var fireId = 2;
if (elements.contains(fireId)){
var rate = 100;
value += Math.ceil(value * rate);
target._checkFireDmg = 1;}
</Custom Confirm Effect>

<Custom Action End Effect>
if (target._checkFireDmg > 0){
target.removeState(28);}
</Custom Action End Effect>

<Custom Remove Effect>
target._checkFireDmg = undefined;
</Custom Remove Effect>
By doing this, the state will only be removed once you deal Fire Damage in "Confirm Effect" and will not be removed when your caster finishes casting the skill on himself.

I am probably doing something wrong besides the notetag..

I also tried using both the notetags from kirbwarrior and it still doesn't work.

I have the plugin console on boot, and the error I posted before was the entirety of the error message in that console. Is that what you mean by "console picture log?"

I'll try to explain everything I did since I may have a stupid mistake elsewhere.

My goal is to create 2 abilities;
1. When I cast Fire magic, the next wind or water spell is buffed.
2. An AOE fire spell that gives everyone in the party Fire Sword and buffs fire damage by 50% for the party.

With the advise in this thread, I got the fire sword working with an AOE fire spell, but the fire damage buff isn't working.

I have created a new spell entirely that gives my fire buff state to one person, to try to make sure it works before incorporating into the spell I want.


So here is what I did:

I created a trait that has;
no restrictions
no overlays
it is removed at the end of battle
auto-removal timing: Action End with 5 ~ 5 duration in turns
I added a message to sat (Target Name) Gains the Buff!!
I have no traits.
In the notes: I have tried what I copied into a previous post, and the following 2 suggestions.

I created a skill that has;
Black Magic: so my mage can use it
0 MP 0 TP
Scope is 1 ally
Occasion is Battle Screen
I changed nothing in Invocation
Message: I added casts %1!
No rewuired weapons
No damage
Effects: Add State - the state I previously made at 100%
Note: none

The skill I use to use if it worked is Fire, black magic, and I set the damage to fire element and it does 50 flat damage with no variance so I can be sure if there's any increase.
Can you take some pictures of your skills, states and the console when the error occurs? A picture is always worth a thousand words and it should be easier to analyze the problem. I will check them soon. Gotta get some sleep first it's after midnight here already.
@JamesRyan okay, that seems to function as I think @Kevin Hirst wants, after I changed "target." to "user." in the Confirm Effect.
Here is the skill I created just to apply the state
upload_2017-10-21_14-48-28.png


Here is the state that is applied
upload_2017-10-21_14-49-7.png


Here you can see in battle that the state is actually applied on Marsha
upload_2017-10-21_14-49-32.png


And then here you can see that after I cast a fire spell with Marsha, she loses 1 stack of the state. Also the console log with the error.
upload_2017-10-21_14-50-33.png



Also, here is the skill screen showing the fire spell I used.
upload_2017-10-21_14-51-46.png
This is going to sound silly, but have you saved your game? Modifying things that affect plugins don't always work in Battle Test unless you save the game before hand. Are all of your plugins up to date? Lastly, does the error still happen if the only plugins you have active are BattleCore and BuffStatesCore (and core engine if you are using it)?
I use the playtest button to play the actual game rather than the Battle Test battles. This asks me to save every time I press it if I haven't

I turned off all plugins besides YEP_CoreEngine, YEP_BattleEngineCore, and YEP_BuffsStatesCore and I tested the game again.

Here is the new error message. I cast fire 3 times, that's why the repeat.
upload_2017-10-21_15-5-33.png



I got curious about making sure nothing else was interfering, so I starting a brand new project, and used only those 3 plugins mentioned. And created only 1 new ability and new state. The same error attached here is what I got again.
@JamesRyan okay, that seems to function as I think @Kevin Hirst wants, after I changed "target." to "user." in the Confirm Effect.
It's not a big problem to change "target" to "user", but keep in mind that the system might misunderstand your purpose. If you have a skill with scope "Self", "user" and "target" are the same. But if i'm not wrong, once your skill can be cast on other ally, "user" might be referred to the caster which does not have the state to be removed.

@Kevin Hirst, i see no issues in your setup. Did you start a new game each time you playtest? And have all your YEP plugins been up to date? The Core Engine version should be 1.25, Battle Engine should be 1.45 and Buffs & States Core should be 1.14.
And the most important thing is, have you updated your project? The engine might be updated automatically if you use Steam (current version is 1.5.1), but your project is not and you have to do it manually.
All my plugins are up to date. But, I was using game version 1.0
I got optimistic as I thought I found the issue. Too early..


I updated my game to version 1.5.1 and manually updated my project. But, I am still getting am error message in the console.
I even created a new project after I updated the game to ensure that I was using an updated project. Still the same error.

I even tried all the different notetags suggested in this thread.

I am so confused.
But if i'm not wrong, once your skill can be cast on other ally, "user" might be referred to the caster which does not have the state to be removed.
That's actually why I did that. With it being target, every section other than Confirm Effect treats user and target the same, but Confirm Effect target is the target of the skill. Or at least, that's what I'm getting from what I'm reading and the resulting effect.
All my plugins are up to date. But, I was using game version 1.0
I got optimistic as I thought I found the issue. Too early..


I updated my game to version 1.5.1 and manually updated my project. But, I am still getting am error message in the console.
I even created a new project after I updated the game to ensure that I was using an updated project. Still the same error.

I even tried all the different notetags suggested in this thread.

I am so confused.
Lol this really confuses me. I don't see anything causing the problem.
@kirbwarrior, did the note tags work for you? Or do you have any trouble with Buffs & States Core plugin like @Kevin Hirst?

Original thread: https://forums.rpgmakerweb.com/threads/state-to-increase-a-specific-elements-damage.86044/