score damage

I am making a damage system based on attack type statistics, critical damage, critical probability, elemental damage, which replaces the base damage, that is, when the weapons hit you actually hit an interaction entity and the damage is calculated in based on the statistics and you are given a total damage score and with that score you summon in front of you an armor stand that does the damage, for example if you landed a hit and after all the calculation it gave you 20 damage you will summon an armor stand with the 20 damage tag and that armor stand will execute the damage command and say that it does 20 damage, the problem is that I waste a lot of time having to take all the damage variants that can be done, there is no way to Will my damage score be transformed into damage directly with the damage command?

Continue to help post