If China tried to take over Taiwan
They'd need to bring the full force of their military to do it. Taiwan buys weapons from the US, so they'd put up a good fight, but unless the US wanted to become directly involved in such a war China would have its way eventually as Taiwan would be outgunned and outmanned.
There is, however, a 0% chance that they'd get TSMC's fabs - and the equipment inside - intact, so this would do fuck all for getting them leading edge semiconductor manufacturing capability. Either the equipment would be packed up and airlifted out before the fighting reached that area, or Taiwan's military would make sure the fabs along with the valuable equipment inside were destroyed before surrendering. And China knows that.