For your first question,
this ought to be of some use.
For your third question: it's mostly a simple matter of taking your desired minimum value and adding Math.randomInt() to it. A rough exact formula would look something like this:
Min + Math.randomInt((Max - min) + 1)
Where Min is your desired minimum value and Max is your desired maximum value. Some examples:
Min = 2, Max = 4: 2 + Math.randomInt(3)
Min = 3, Max = 7: 3 + Math.randomInt(5)
Min = 10, Max = 13: 10 + Math.randomInt(4)
I'm not entirely sure what you're asking for your second question, but to me it sounds like you want something like Formula1 + Formula2 = Final Damage Value that produces 1 Damage Popup. In that case, it really is as simple as putting the two formulas in parentheses and then adding them together. If that's not what you're looking for, then I'm not sure how to answer that, unfortunately.
Now for my own question.
I'm trying to design a damage formula with a sort of "soft cap" on both maximum and minimum damage values. Basically, whenever the damage approaches some kind of maximum value (like 9999 or half the target's maximum HP) or minimum value (like 10 or a third of the attacker's offensive parameter), the damage kind of levels out. For example, if the "soft cap" is 9999 while the final damage would otherwise be twice that, it'd instead be something like 10,100 or even still below 9999. Likewise for minimum damage: if the "soft cap" on minimum damage is a third of the attacker's offensive parameter, I don't want any damage to be drastically below that. All this while the damage in between the two "soft caps" is more or less normal for whatever formula I decide to use (I normally use something like a.atk * (256 - b.def) / 256 or a.atk * 100 / (100 + b.def)).
I'm completely at a loss at what kind of math I'd need to do to achieve this effect. It feels like the exact curves I want look similar to a square root formula (for max "soft cap") or exponent formula (for min "soft cap"), yet whenever I play around with such formulas in a graphing calculator I simply cannot get the curves to look the way I want them to. Would anyone have a better idea of what formula I would want for something like this?
I'm aware I could achieve something similar via the Math.max/Math.min or clamp functions, but that's not quite what I want. Those are a hard stop that cause the damage to turn into a flat line at the maximum and minimum values (variance notwithstanding); I'm looking for something that'd be more of a curve at the "caps."