MV Reduce MP cost via state

Heyho!
There are two things I'd like to accomplish, most probably via Yanfly's Buffs & States Core.

1. A state that reduces the MP cost of any skills of the wielder, dependend on how much MP they have left. The less MP, the lower the cost. The formular I'd apply would be: (cost * user.mp / user.mmp).

2. A state that reduces the MP cost of skills with a certain element by halve. For example all skills with the element fire cost halve the mp they normally would.

I'm guess it's also possible with Skill Core, since Custom MP Costs are introduces, but that would mean having every single skill doing a check if the state is active, right? Hopefully there is a less time consuming method 😉

Thanks in adavance!
I don't see how.

The only thing you could do in a state notetag is refund some MP if the selected action is a certain skill/skill type/element/whatever you want to check for.

To actually make it cost less, you have to use the Custom MP Cost notetag on the skill.
Hmm, how about using the Special Parameter "MP Cost" as a trate of the state. It won't be the formular i originally intended to use, but it should be possible to create a passive state that activates when the MP drops under 50% for example. This state then lowers the MP Cost using the trate.

Either

<Passive Condition: MP below 50%> <Passive Condition: Switch 20 ON>

or (using Passive Condition cases)

<Passive Condition Cases> MP < MMP * 0.5 Switch 20 ON </Passive Condition Cases>

should work, right? I remember having some issues with multiple conditions that's why I'd liek to check both.

For #2 it seems best to go with the Custom MP Cost notetag for all the water skills, but I am not sure if it's possible to set a condition, that asks for a specific state, before reducing the MP cost in this notetag.
Either <Passive Condition: MP below 50%> <Passive Condition: Switch 20 ON>
This wouldn't work, you can only put a notetag into a database element once (unless the plugin specifically tells you it supports multiples).

If you prefer to change your design of the cost reduction instead of copying and pasting a notetag into your skills, then yes you can just put the trait on the state.

For #2 it seems best to go with the Custom MP Cost notetag for all the water skills, but I am not sure if it's possible to set a condition, that asks for a specific state, before reducing the MP cost in this notetag.
Why not?
Code:
<Custom MP Cost>
if (user.isStateAffected(19))
    cost/=2;
</Custom MP Cost>
Ah okay!
I read the part of Auto Passive States description that said "All conditions must be fulfilled in order for the passive state to appear" as multiple conditions being possible.

Thanks for your help (again) ~
Hm! Now that you point that out, I do get what you're saying.

I mean, give it a try, see if it works 😛

I've never even looked at the condition cases one you mentioned, anything that's more complex than the basic notetags I just do in JavaScript in a custom condition.
Maybe you can help me doing that then 😉 because my soluton both won't work. Just as you said, multiple <Passive Condition> notetags seem not to be possible. With my second idea the status also won't activate, probably because a fomular in combination with the comparison is not supported:
All I can do is check if MP are lower then MMP but not MMP * 0.5 as it seems.

So ... how do I create a Custom condition asking for a switch and for a MP value relative to the MMP?

<Custom Passive Condition> if (user.mp / user.mmp <= 0.5 && $gameSwitches.value[20] == true) { condition = true; } else { condition = false; } </Custom Passive Condition>

looks kinda wrong for my unkowing eyes.
$gameSwitches.value() is a function, so it expects an argument to be passed in via parentheses. Using brackets indicates you're referencing an index of an array.

The rest is fine, although you could shorten it a bit by using the included mpRate() function.

So:
Code:
<Custom Passive Condition>
condition = user.mpRate()<=.5 && $gameSwitches.value(20);
</Custom Passive Condition>
Hehe it works now!
Thank you~

Original thread: https://forums.rpgmakerweb.com/threads/reduce-mp-cost-via-state.160135/