Mechanism to handle partially booked order

Let’s say I have purchased 2 lots at 100. And those are to be squared off as T1 (102) and T2 (104).

How do I specify partial exits? Is it using repair condition for T1 and a separate condition for T2?

Also how to handle scenario where T1 is booked and before reaching T2 price SL (say closing below 5ema) is triggered? I mean how to take care of quantity?

How universal exit should be coded to square off either both the lots or a single lot depending on whether t1 is booked or not? Also do we need to use the keyword multiplier in case of universal exit?