For the answer to that you need look no further than their actions against some of their own leading entrepreneurs such as Jack Ma which roughly speaking halved the value of Alibaba and by extension hurt the Chinese economy generally. The CCP plays the long game, they aren't particularly worried about causing the nation short term loss in return for perceived long term gain. The real question is are they prepared to destroy Taiwan's crown jewel, the Taiwan Semiconductor Manufacturing Co, by militarily invading? Taiwan have a very strong military so an invasion by China would be an extremely messy affair which would likely result in the destruction of much of Taiwan's infrastruture including TSMC. I would imagine that if the chips were down and the war lost, Taiwan would destroy TSMC themselves rather than hand it over to China.