Chain of Suffering Macro?

So im looking to add a macro to my GSE macro that will try and use my Chain of Suffering Trinket.

So Chain of Suffering needs to target a friendly character to use. It would be really good if I could target whoever is closest to me to use the trinket on but still continue targeting my current target or just retarget my current target afterwards.