My understanding of the FIF threshold is that the total cost of foreign investments has to be 50k or less to not be taxed.

So lets say I want to keep my threshold under so I purchase 50k of foreign share A. One year later I decide I want to reduce my position in share A and purchase new foreign share B.

Am I able to stay under the threshold by selling 25k of share A and purchasing 25k of share B?

What if the total value of share A is now 100k, can I still do the same thing and remain under the threshold (sell 25k worth of share A and invest 25k elsewhere)? How about selling 50k worth, would that mean the total cost is 0 so it is no longer counted at all?

Thanks, hopefully I explained that well enough.