Small Damage Formula Question

Is there a way to create "guaranteed damage" in a damage formula? Say I have a very basic formula for a skill:

1.5 x (Actor's strength stat)- 1 x (enemy defense stat)

If the enemy's base defense is greater than the actor's boosted-strength, the skill will do 0 damage. Is there a simple way to ensure that the skill will always do a guaranteed amount of damage no matter how high an enemy's defense is? Like there will always be a guaranteed 0.3 x (Actor's strength stat) that is inflicted ignoring enemy defense. I have a means of chaining skills together to create this bonus damage effect, but I just wanted to know if there is an easier way to do this. Thank you to anyone who replies!
You could add something like this to the end of your formula:
Code:
(your formula here) + (0.3 x a.atk)
This should add the last formula to your already calculated damage, making sure that that amount is always the minimal damage done.
I'm pretty sure this would work, but not completely certain since I don't mess with formulas and skills in general very often.
A very easy way to do it is to add + 1 to the end of your formula. Then it can't do less than 1 unless there is an error in your formula.
@SmashArtist
I played around with this, but it doesn't seem to be working. I set up a skill with the exact damage formula from the original post but used by an actor with less attack power than enemy's defensive power. I added your additional formula to the damage formula, but I kept hitting zeros.

@bgillisp
I tried this too, but it also didn't seem to work.
Other people have good suggestions, i'll show what i usually do too

((a.atk*2.5))/((b.def/2.5))+((b.mhp/30))

Edit: @Solr Did you write "your formula here" instead of an actuall damage formula with the first suggestion?
@Solr : the only way that will fail is if your damage formula is broken as even (big mess of formula that evaluates to 0) + 1 is 1. Unless you got your formulas somehow set so that a negative answer is possible, in which case you'll need a script call in the formula to fix that, or a script.
It could also be due to "variance". Set it to 0 and see if it changes anything.
@Solr : the only way that will fail is if your damage formula is broken as even (big mess of formula that evaluates to 0) + 1 is 1. Unless you got your formulas somehow set so that a negative answer is possible, in which case you'll need a script call in the formula to fix that, or a script.
Well, smash artist did use single parenthases instead of double parenthases. That might also be the problem
@Oddball are double parentheses necessary? I've made damage formulas with single parentheses before and they worked correctly.
You can also do something along the lines of:

a.atk > b.def ? damage formula : 1

That way it will always do at least 1 damage
You can also do something along the lines of:

a.atk > b.def ? damage formula : 1

That way it will always do at least 1 damage
NinjaKittyProductions swiftly did in this problem with a well placed kunai!
@Oddball
@NinjaKittyProductions
@SmashArtist
@bgillisp
Ah dammit, I'm so stupid. I think I've figured out what the problem is. I didn't think I had any scripts that altered the way damage formula's were calculated, but I'm pretty sure that Yanfly Parameter Formulas might. If what @bgillsp said is true, then my formula's are probably being altered by a script, a script which is absolutely necessary to the function of my project. I guess I'll just have to chain skill together in a clunky manner. I apologize for wasting everyone's time.
@Solr - what bg said was that your actual formula might have errors in it (this makes the formula always return 0 because of safety applied), or your formula returns negative, so the game makes it 0 (damage cannot go below zero). He never said that your formula is being changed by a script.

Please post the actually formula you have written so that we can check. It would also be good if you can also post the stats of the actor and the enemy that you are using to test.
@Solr - what bg said was that your actual formula might have errors in it (this makes the formula always return 0 because of safety applied), or your formula returns negative, so the game makes it 0 (damage cannot go below zero). He never said that your formula is being changed by a script.

Please post the actually formula you have written so that we can check. It would also be good if you can also post the stats of the actor and the enemy that you are using to test.
myformula.png

Well here's my formula. I don't believe I made any errors, but this is it.
You don't need the times 1's. my proof? What's 5 times 1? the times 1's won't change anything. Other than that, the stuff in parenthases is being added to the enemies deffense. There's your problem. Addition comes before subtraction. Try using multiplication/division for your formula instead, (except for the addition part) that will fix the problem
What's your actor's attack and your enemies defense?

@Oddball - actually, his formula is fine. Addition and subtraction proceeds in the same manner. Better grouping looks better though, so I'd actually suggest doing

(a.atk-b.def)+a.atk

Though TBH, this is no different than just doing

(a.atk*2)-b.def

So in the end, if the target's def is at least twice the user's atk, it will still be 0. So as I said in my previous post, we also need the atk of your actor and the defense of your target..

In any case, Ninja's formula would work better to ensure non-0 damage.

Code:
a.atk > b.def ? (a.atk-b.def) : 1

If attack is higher than defense, use the damage formula, else, deal 1 damage
You don't need the times 1's. my proof? What's 5 times 1? the times 1's won't change anything. Other than that, the stuff in parenthases is being added to the enemies deffense. There's your problem. Addition comes before subtraction. Try using multiplication/division for your formula instead, (except for the addition part) that will fix the problem
I just like writing the "times 1" because I work with computer's (not programming) and I find comfort in redundancy.
@Engr. Adiktuzmiko but the whole point of this thread was to try to make part of the damage formula ignore enemy defense. The attack of my actor is 10 and the defense of my enemy is 30. I was trying to make it so that no matter how high the enemy's defense is, (a.atk x 0.3) will always be inflicted to the enemy's HP, ignoring defense. I was trying to see if it could be preformed right in the damage formula, without the assistance of the script.
Your posted formula will ofc not work because as I said, its just the same as atk*2-b.def, so in your case it will be 20-30 so ofc it will still be counted as zero damage. Its simple math.

Please read my whole previous reply again, at the very end I told you that Ninja's formula would work to ensure non-zero damage. Just change the 1 to whatever damage or formula you want for the non-zero damage.
Would this work?

((a.atk*1 - b.def*1)) + a.atk*1

Edit: Also, using multiplication/division for the formula part and addition for the garunteed part works too, sense with multiplication, the smallest number you get is 0
With the damage formula:

a.atk > b.def ? formula here : (a.atk * 0.30)

You can change any part of this. This is a standard if statement. If a.atk is greater than b.def then formula else (a.atk * 0.30). No scripting needed. Vx Ace allows you to use statements in the damage formula... I do believe it is limited to 144 characters though.

Original thread: https://forums.rpgmakerweb.com/threads/small-damage-formula-question.114232/