1
So far I understood, you want to calculate the base price from the total price should be inclusive of tax (i.e reverse calculattion tax), right? then use the below formula
var basePrice = PriceIncludingTax / (1+Tax/100);
test with number
var basePrice = 790/ (1+5/100); //5 is your tax percentage
i.e 790/1.05;
ans: 752.38; // this is your base price excluding tax
Do let me know, if you need some more clarification