I'm sorry for the double post earlier, my bad.
I've checked the two functions GetInstanceLockTimeRemaining() and GetInstanceLockTimeRemainingEncounter(), and unfortunately they return valid result when a player is about to be saved to a partially done instance. If I just run them mid-raid, they return "0" for completed/dead bosses.
I thought of using
GetSavedInstanceInfo, but this won't work for LFR or LFG instances.
If anyone knows a valid way to get current instance progress, I would be happy to get some help here.