Help with a particular skill cost formula string

I'm using Yanfly Skill Cost Manager http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/skill-cost-manager/

I'm asking for what the normal ruby code would be for this to see if it's compatible with this script

(I would use Mr. Bubble Blood Magic but that doesn't support custom formulas, like skill exp affecting the cost of a skill and whatnot)

I'm trying to make it so that a skill will cost HP if state 26 Blood Magic is on, and will cost MP if state 26 is off.

I'm thinking something like

<custom cost perform>(self.hp -= (10 * self.xstat.hpc) / 100 if self.state(26)?) (self.mp -= (10 * self.xstat.mpc) / 100 if !self.state(26)?)</custom cost perform>in the comment box.

Mind you, self.hp -= (10 * self.xstat.hpc) / 100 and self.mp -= (10 * self.xstat.mpc) / 100 do work individually.

Don't mind the xstat.hpc and the xstat.mpc. Those are custom stats from Crystal's Extra Stats that mean HP Cost and MP Cost because I was having problems with the integer function of the regular mcr and whatnot and are irrelevant to my question.

How would I go about what I'm trying to make?
What is the script you're using? Please post a link.


I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
I'm using Yanfly Skill Cost Manager

http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/skill-cost-manager/

I'm not sure why I didn't include that, and, I wasn't sure if to add it to that one or to the VXAce thread.
VX Ace thread? If you're talking about THIS thread, I moved it from there to here, because it's to do with a custom script 😉
Mind you, self.hp -= (10 * self.xstat.hpc) / 100 and self.mp -= (10 * self.xstat.mpc) / 100 do work individually.


How would I go about what I'm trying to make?
You first have to describe what you want to try to make, because you didn't even assign an operand between the two parts that work individually. If you want both single parts executed, then you need to tell the engine that they are two different commands - placing them in the same line without anything between them doesn't tell that to the engine...
I don't know what to put between them.

That part was to say that the mp and hp cost function work on their own.

self.hp -= (10 * self.xstat.hpc) / 100 

means

subtract HP by amount of (10 x HP Cost {which is defaultly 100, meaning 100%}) / 100

and

self.mp -= (10 * self.xstat.mpc) / 100

means

subtract MP by amount of (10 x MP Cost {which is defaultly 100, meaning 100%}) / 100

I want to make it so that if if the user has state 26 applied, the equation self.mp -= (10 * self.xstat.mpc) / 100 is applied, and if it is not applied, then self.hp -= (10 * self.xstat.hpc) / 100

self.state?(26) self.hp -= (10 * self.xstat.hpc) / 100 : self.mp -= (10 * self.xstat.mpc)does not work

Not even

<custom cost perform>a.state?(16) hp -= 100 : mp -= 20</custom cost perform>to simplify and test. 

Do you know how to do this?

Edit-

Turns out that

<custom cost perform>if self.state?(26) ; self.hp -= (10 * self.xstat.hpc) / 100; else; self.mp -= (10 * self.xstat.mpc) / 100; end;</custom cost perform> works.

But, what if I wanted multiple conditions? Like

if self.state?(26) or self.state?(27) or self.state?(30); self.hp -= (10 * self.xstat.hpc) / 100; end; if self.state?(31); self.tp -= (10 * self.xstat.tpc); else; self.mp -= (10 * self.xstat.mpc) / 100;end;meaning if you have the blood magic states of 26, 27, or 29, then it uses the HP Cost formula, and if you have state 31 then it uses the TP Cost formula, and elsewise it uses the MP Cost formula. 

You see, when I put in this code, using that end in the middle to divide them makes it out like 2 different conditions, where state 26 is active so it costs the user 10 HP, but state 31 is inactive so it also costs the user 10 MP, ultimately costing me 10 HP and 10 MP.

How would I make it so that it's 

If this then that and if this then that but elsewise then that
Your original formula is wrong because it's like this: (formula1)(formula2) it doesn't make sense... since ; is like a manual line break, it now worked... XD...


as for the second query, I think you want an elsif

Code:
if self.state?(26) or self.state?(27) or self.state?(30); self.hp -= (10 * self.xstat.hpc) / 100; elsif self.state?(31); self.tp -= (10 * self.xstat.tpc); else; self.mp -= (10 * self.xstat.mpc) / 100;end;

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-particular-skill-cost-formula-string.24578/