I hate to correct you, but this just isn't true (unless you were referring to some kind of monitor that draws power from the computer?).
I have a second monitor on my MacBook Pro, and can unplug the power easily and the machine just keeps right on going, with the second monitor behaving exactly as normal.
Not all of them do - Neither my MBP nor my MBA will detect a TV if they're running from battery. Have not tried having the power plugged in while connecting to the TV and then unplugging the power to see if it will continue to function as you're noting.
In the ops case, if this is an issue of the connection to the TV use to work and now it's not, I'd try:
a) disconnect and reconnect the cable from both the MBP and the TV.
b) SMC reset, while you're at it, may as well do a PRAM reset
c) adapter and/or cable - try a different one - if using an adapter, try it first, there are many more reports of adapter failures than cable failures