NATO can only do something if NATO is attacked first. It can't do pre-emptive attacks. It depends a lot on the party in power in the US as well as the sentiment towards China. A lot of working class people might see it as a way to prove why shipping jobs and manufacturing there was a bad idea.
NATO absolutely can attack without being attacked first.
I can't tell you what will happen if Taiwan is invaded tomorrow, next year, or twenty years from now, but I can tell you that the US will think long and hard about whether or not it will want to get involved. And it might well choose not to.