Withdrawing of H1 b Petition while changing companies

I am working with Company A who has filed for my H1 B Pettion in fiscal year 2013. Due to some personal reasons I will not be able to travel to USA. So when I resign from Company A and join Company B, if the Petition is withdrawn, what are the charges to be paid? and Do I have to legally pay them to Company A?

Normal USCIS H1B fee is 2300$. Its all depends on your company A like how much they demand you or NOT. There is nothing legally you need to pay. Its all the company A which decides how much they are going to collect from you based on Company A’s policy.