The total cost to cast Ghalta is locked in before you pay that cost. For example, if you control three 2/2 creatures, including one you can sacrifice to add , the total cost of Ghalta is . Then you can sacrifice the creature when you activate mana abilities just before paying the cost.