Oh i was using d&d as an example that easier to understand than the actual stats im messing with in the Divinity engine 2...

In the games engine damage in the weaponstat is treated exactly as i described with the dice...
A very easy way for you to test this yourself is create a stat-weaponstat and assign 1-6 as the damage for each element then attach those boost to a sword via a skill or creating your own item...attack any creature of even level with varied resistences theres a few you can use in the templete. Youll very quickly notice it indeed takes resistences into account and the damage is indeed a random roll on the set value.