Considering Japan’s pacifist Constitution, I am not sure legally how they would be allowed to respond if just Taiwan was attacked. Additionally the Chinese would more likely blockade Taiwan prior to any attack which makes Japanese involvement even more Constitutionally difficult:
Tokyo would step up militarily to defend Taiwan if Beijing moved to reunify the island with mainland China by force, former deputy national security adviser Matt Pottinger said in a panel discussion on Tuesday with other top Trump administration officials.
Pottinger, considered one of the key architects of the Trump administration’s hardline China policies, said Japan first suggested a quadrilateral alliance with the US, India and Australia – now known as the “Quad” – as a defense strategy against China. He also pushed back on assertions that the former administration strained ties with Japan and other allies in the region. (…….)
“There’s a saying in the Japanese military: ‘Taiwan’s defense is Japan’s defense.’ And, and I think that Japan will act accordingly,” Pottinger added.
Korea Times
You can read more at the link.