[C++ Script] Shared boss health

So I’ve wrote a script for Kor’kron Dark Shamans that works perfectly on trinity core 6.x branch, but I have 1 problem, I do not know how to implement shared boss health. I’ve been trying to find some bosses that do have this implemented but still I did not see solution on how to do this. So I am asking for help here.

Have you looked at how the council works in black temple? (the 3 bosses right before illidan stormrage)

Well I implemented it the same way and now it crashes the worldserver.exe when the boss is started

So you probably did something wrong then. Debug it?

Set Health.

[ol][li]else if (e.action.sethealthpointorpercent.healthpointmod == 2)[/li]li->ToUnit()->SetHealth(me->GetHealth());[/li][li]else if (e.action.sethealthpointorpercent.healthpointmod == 3)[/li][li]me->SetHealth((*itr)->ToUnit()->GetHealth());[/li][/ol]
For example.