added Basket Plugin - Check VAT ID

I need some help adding the Basket Plugin for the VAT ID Check.
If VAT ID is set, the taxrate must be removed. 
If VAT ID is removed, the taxrate must be added again.
If the VAT ID is set, loop over all products, save it's tax rate and original price according to its position, set the net price with price/(100+taxrate)*100 and set the tax rate to 0.00.