What happens if Japan refuses to pay the U.S. for its military presence? Is there a procedure for such a situation? Or would the U.S. simply pull its troops out of Japan and let Japan fend for itself? I am asking because at a certain point Japan might prefer to defend itself considering the U.S. might not remain a reliable ally.
The US has bases like Kadena Air Base (or for that matter Ramstein in Germany) not solely for the protection of the host countries. These bases are part of a web which allows the US global influence and power projection. So the US would have to think hard how much the bases on Japanese soil are worth to them.
They might have lawyers look into the terms of the bases, too. Cuba is no longer happy about Guantanamo, but the lease has no end date. But I can't really see such a scenario vs. Japan.
The Philippines threw the US out of Subic Bay because the US didn't want to pay enough for the lease. This could be seen as a precedent that the US is actually willing to walk away from a base, or it could be one less alternative option in the region. Are Guam and Korea enough? So perhaps the outcome could be a three-sided bidding between the US, Japan, and South Korea. How many bases, and where, against which security guarantees, and who pays whom how much. Compare the recent suggestions that the US should relocate from Germany to Poland.
As a side note, the only thing stopping Japan from becoming a nuclear power are domestic and international politics. It is in the interest of the United States and in the interest of world peace to keep it that way, and a credible "nuclear umbrella" helps in this regard.
At some point, the US administration would have to make the judgement: "are the benefits of our continued presence in Japan worth the cost?" Indeed there is likely to be an ongoing cost-benefit analysis of any military deployment.
The benefits are complex and in some ways intangible: There is the projection of power across the Pacific. The maintenance of an effective alliance with Japan. The support of a government that tends to support the USA. The costs are both financial and matters of risk. That is the risk getting drawn into an Asian war and risks of causing issues with Japan's neighbours.