favorite bit about Star Trek is how because of how television is produced on earth and not in space the writers had to decide that the artificial gravity is always 100% the last thing on a ship to ever fail, no matter how damaged the ship is. The whole ship could literally be dead, motionless, and leeching heat to the void, and the artificial gravity will still work.
Unless it's directly sabotaged like in Undiscovered Country.