While many factors can determine the actual cost, you can still estimate your obligation. For example, if it contains R-22 refrigerant, it needs to be replaced because R-22 will not be legally available after 2020.
According to HomeAdvisor, the average range to repair an AC unit in the United States is $163-$520. If your HVAC unit is more than ten years old, it should be replaced. An AC unit may be expensive, but it could end up saving you money.