I mean, if we are going to assume “China attacks Taiwan” means “China attacks US bases in Japan” we might ad well assume it means “China preemptively carpets Japan with nukes rendering any Japanese response irrelevant”, but in any case, no one is arguing that Japan would either not react to an actual attack on Japan that left them capable of response or would require Constitutional changes to do so. But “Japan” and “Taiwan” are still different things.
Since the US would come to the defense of Taiwan, it would use assets in the region so that includes naval and air assets. The air assets are based in locations such as Guam and Japan (among others). The US would launch sorties from those bases amongst others.
Can you think of a scenario in which China would attempt the worlds all-time largest amphibious invasion of Taiwan and then let the US just fly missions and drop in supplies or attack Chinese assets and not respond to the bases themselves? It seems incredibly unlikely to me.
There aren't any nukes that need to be involved here. Certainly there are potential scenarios in which those do get used, but neither the Chinese nor Americans have any strong desire to escalate a conventional war into a nuclear war. The scenario you are assuming would also include China and the US nuking each other and so that scenario itself is a bit silly whereas China attacking US air bases in the lead up to or during an invasion of Taiwan without escalating to nuclear weapons is a pretty serious scenario.
I get your point about Japan not being able to change their constitution so quickly and I don't disagree, but I think any scenario in which Taiwan is invaded and the US comes to its defense will drag Japan in to the war sufficiently enough that it will justify whatever it needs to do.
The US will never come to the defense of Taiwan. The US and China will never go to war with each other. Nuclear powers do not fight each other directly, they do it through proxies, like we are doing with Ukraine vs. Russia.
The U.S. might send money and materiel, they might get the U.N. to issue statements, but an actual shooting war between China and America? Forget it. It will never happen, because if it did happen, life would not be worth living anywhere on earth for the next 50,000 years.
And even sanctions are highly doubtful. Personally, I really like being able to design a circuit board and get it fabricated and shipped to my front door from China for $25. And massively interrupting the trade flow between China and the U.S. would lead to a world-wide depression which would make 2008 and the great depression look like boom times.
Surely Taiwan knows this, and I suspect that is why TSMC wants to build fabs outside of Taiwan.