Your analysis is too simplistic. Yes you can take a cost basis. I simply leave them two different positions for calculations purposes. But if you want to take a cost basis you can by simply figuring it out.
Lets assume Stock A was $5 when PSL 21 Started.
After some time Stock A decline to $2. You decide to sell stock B to DD. Stock B was up 50% when you sold.
Under that scenario 200/$5 and 750/$2= Cost basis Would be $2.63
If stock B was sold unChanged when sold. The cost basis would be $2.86. So the point is stock B performance when it is sold determines the cost basis. Hoep This Helps.