Games' damage calculation

I was trying to design my own Tactical RPG at one point, and was trying to get everything to make sense on paper.

To Hit
[(Stat + Weapon Modifier) x (Skill Modifier) x (Range Modifier + Elevation Modifier)] - [(Stat + Armor Modifier) + (Face/Flank/Back Modifier) + (Defensive Skill or Action)] = To Hit %

For Damage
[(Stat + Weapon Modifier) x (Skill Modifier) x (Elemental Modifier) x (Range Modifier + Elevation Modifier)] - [(Stat + Armor Modifier) + (Face/Flank/Back Modifier) + (Defensive Skill or Action)] = Damage

This isn't complete as I also had a few other things in there to determine if a hit would be a critical and what the critical multiplier would be (multiplier would be weapon or skill dependent, greater value takes effect, doesn't stack). I also had a part that'd determine if a character would be knocked prone or back by a powerful hit, but again, don't remember the exact details; but had a Constitution check in there. Pretty much, the Stat would be one of the main 6 D&D stats; Strength, Dexterity, Constitution, Intelligence, Wisdom, Charisma. Different classes, weapons, and skills would affect such things. From there it came down to weapon choice, spacing, height difference, and the like to determine if there would be a hit and/or damage.
 
If you want, post why you think your formula is better, or what does it try to accomplish.
This is actually a really interesting topic as you want a system that is consistent but hard to figure out so that it's not too easy to game by simulation. It's almost like making a search engine as you want people to find what they need, but you don't want it to be exploitable.

With that in mind, consistent but sim-able is probably better to completely random as WoW had a major issue in WoD where you can do the same exact steps each boss fight on a simple boss stage and get massive variance in the scope of 30% which makes it unplayable as depending on how random things proc you can either have an incredibly easy time or be unable to actually clear a phase. I think they figured it would average out, but because of how things worked there were too many situations where too many people just didn't do damage randomly and other situations where you'd proc too many transition phases because you did too much damage.

You also probably don't want it to be too based on a gear set as not only does loot make things weird then, but you also end up swapping to many parts around each fight which becomes too annoying.

Maybe something like hidden resistances to certain types of damage and that way instead of doing things where a boss takes bonus damage under some conditions your various forms of damage that level out due to those resistances aren't so smooth. The problem is still simming, but you can probably create a system that averages things enough or creates random points within a fight that it becomes a bit more murky where it matters without it being noticeable.
 
Back