The average damage dealt by a unit is equal to 1/4 of the unit's HP, therefore the stack will decrease by a quarter, which is directly proportional to the damage.
Your point will be absolutely correct only in the case of fixed damage, regardless of other circumstances. If you suggest considering the damage as fixed, I will accept your version, and in the future, we will simply keep in mind that we have included some error in our estimates... Or even better - I suggest introducing a progressive scale. For units with greater defense, introduce a certain compensating coefficient that reflects their higher resistance to damage received... I am sure you understand my idea... Otherwise, it will be too crude...
For reference: if the attacker's attack is lower than the victim's defense by 28 or more points, the attacker will deal exactly 0.3 of his damage... This limitation is set by the developers... For example, for a Lazurite Golem, this will be true in almost any battle where its opponent is below level 7... Only champions have enough attack to deal more than 0.3 of the base damage...