This has probably came up before but... Lets say a troll that has fire and acid resistance is knocked unconscious due to non-lethal damage, if you attempt to coup de grace that troll with a weapon that does fire or acid damage would you have to do more fire/acid damage than they have resistance or does the attack kill them?
Bear in mind that a coup de grace isn't an auto-kill even at the best of times - the attacker gets an auto-critical-hit (with sneak attack, if applicable), and then the victim gets a Fort save vs DC (10+damage). (Perhaps ironically, the last time this came up IMC, the target involved was indeed a troll - and it successfully saved.)
If the creature attacked has Damage Reduction, Energy Resistance, or similar, then the damage done is reduced first, and then the save is made. So, the save becomes easier. And if the Damage Reduction, Energy Resistance, or some other effect reduces the damage dealt to 0, then no save is required - the coup de grace automatically fails.
So lets say that a troll has fire resist 5 and I hit him with a flaming sword, would I have to do 6 fire damage for the coup de grace to succeed? or could I do less?
You would need to do a minimum of 6 fire damage. Any less than that, and the damage is reduced to 0, so the coup de grace auto-fails. (Worse still, even if you do 6 damage, the DC of the save is only 11 (10 + 1 damage, of course), so the troll saves on a 2 or better.)
Also, lets say that the troll is immune to fire and acid (and has resistance). Could I still coup de grace that troll, or is it a troll with immunity to fire and acid non killable via damage or a coup de grace?
The troll would be effectively unkillable by damage.
However... I would note at this point that once the party reach the point where all the trolls are effectively disabled (because any time it regenerates the fighter just puts it down again), I would be inclined to simply handwave some means for the PCs to finish it off. Otherwise, the game is liable to bog down and become extremely frustrating, because the PCs won't leave an enemy behind them (to regenerate and attack later), but also can't really deal with it.
I'd also never throw a monster at my party whose defenses are the same as its weaknesses. Weaknesses are there for a reason.
This also. However note that, per the DMG, some 20% of encounters should be 'trick' encounters - if the PCs work out the trick then they're expected to be quite easy, but if they don't then they should be very hard. Thus, a troll with
protection from energy cast upon it is fair game - the 'trick' is that they should cast
dispel magic to get rid of the protection.
But, sure enough, a blanket immunity to fire, or a protection that cannot be removed is excessively harsh.
To be fair, since drowning actually deals hit point damage, I'm not entirely sure you could drown a troll. The troll would drop to -1 HP, but, his regeneration would keep bumping him up positive on his turn. So, the troll would fail its Con check, drop to -1 HP on the next round, then be positive HP in the round after that as the regeneration would kick in, and the troll would again drop to -1 HP, on and on forever. Bit wonky. But, then again, you can cut a troll into itty bitty pieces and it will grow back, so, it's not like it really has to breathe.
Technically, I think you're wrong. The troll's regen works by converting real damage to non-lethal and then removing that
non-lethal damage.
Drowning doesn't cause damage, technically, it
reduces the victim's hit points to -1. Because of this, regen can't convert the damage to non-lethal, and can't then remove the non-lethal damage (because there isn't any).
But that's hellish nitpicky, rules-lawyer-y stuff. Honestly, if the PCs are at the point where drowing the troll is a viable tactic, we're probably at my "handwave a way to finish it off" stage anyway.