The PRC's strategists have certainly been doing those same calculations for many years now. If there is an invasion, it would not be to capture TSMC "alive". That may be a bonus objective, but it can't be the main objective. The West would also most certainly put an embargo on electronics manufactured there after an invasion, so we're at best talking about a bonus objective that may help China's internal market.
On the cost side, China would not be able to continue trading with the West in any meaningful sense. The Earth's economic sphere would split in two. That's a huge price to pay for a largely symbolic imperial gain.