While I find it a bit hard to understand the logic behind what you are trying to do, this is your mod
. Here is an idea on how to solve your problem, in a way:
Instead of damage bonus (or total) of (acc-dodge)*n, use acc as bonus damage and dodge as bonus armor.
This means that the higher accuracy the unit have, the harder and more frequently it will hit, and the more dodge the unit have, the more armor it will have.
The armor against the arrows can be added by 1 of two ways- adding it directly to piercing, and update the other weapons accordingly, or create another attack/defense type, though it might take some work and might be bugged.