My sense is that China will attack Japan before they attack Taiwan.
Japan is stronger militarily than Taiwan. What Taiwan should have been doing all this time is buying as many missiles, rockets and drones as they can. A missile can destroy a warship or a fighter jet and more cost effective than buying older F-16, fighter jets which the Chinese will destroy just because they have numerous fighter jets to attack Drones are very cost effective too as attack weapons as shown in the Ukraine war. Taiwan should start manufacturing missiles and storing them. Ammo runs out faster in a war, as Ukraine is finding out the hard way. If you run out of ammo, you are dead. The other guy will finish you off and there is no way for you to save yourself outside, of outright surrender.