(16 + your attack Modifier) Subtract (1/2 the AVERAGE DAMAGE of your HEAVY WEAPON) 16 becomes 14 if advantage
For Instance: My hexblade Dreslin DeVir’s Glaive attack modifier is +7, and he deals 10 damage on average (1d10+5). He should only take the -5 to hit when the enemy’s AC is less than or equal to 18 (16 + 7) - (10 ÷ 2)