I recently wrote about bosses in tabletop role-playing games and one of the things I mentioned was using twists. What I meant by twists was some kind of monster ability that changes the tactical situation. I only devoted a little bit of time to twists then and I hope to expand on it now. Remember that these kinds of twists are different than a plot twist.
When Is It Needed?
The most common times I see I need to add a twist is when there is a “boss” or when the encounter is composed of a horde of the same creature. When it's a horde, finding a few different creatures can go a long way to helping remove this kind of problem, assuming the added creatures are reasonably complex enough or result in different tactics. The other things I mentioned in my previous article still apply and can be used instead of or along with twists. You should also consider them in situations when you want to expose your players to something new.
Not Only For Bosses
Boss fights aren't the only time an encounter can turn into a slog. Adding a bit of variety to the enemies players face can greatly change the feeling of an encounter. It might make sense to throw as many skeletons as your party is big. However, do this a couple of times and it can get old without twists.
Don't Forget About What's Already There
I've seen often that a Dungeon Master, especially when starting out, will forget about the actions presented in the Player's Handbook. A couple of big ones such as hide and disengage are rarely forgotten but many of the others are. Allowing your horde of zombies to grapple players instead of just throwing attack after attack opens many tactical options. There is also something unsettling for players to see their fighter in the front rank pulled back by zombies, opening a path to the delicious wizard right behind (every zombie knows that wizards taste better). Remembering these options is particularly important for creatures that have fewer options in their stat blocks (zombies are one such example). There are also some items that already open up new tactics for enemies and players. Just also remember that these items may fall into the players hands, opening up new tactics for them too.
The current rules already give something similar to legendary creatures through the use of legendary actions and lair actions when in their lairs. Doing something similar can help change things up. Make sure these new actions aren't all similar though or you'll run into a similar problem through overuse. They also won't be as special and impressive when they do show up. Keeping legendary and lair actions rare helps to keep them legendary instead of commonplace.
One of the most common methods I've seen to add a twist to a character is to play with how they can move. Flight, teleportation, and becoming incorporeal all allow a creature to have a very different movement style. They also prevent the party from cornering the creature and hitting it until it dies. The creature will be able to escape a turn later (in the case of flight it might need to make a trade for some attacks of opportunity).
Does the creature want to do a lot of damage to one target or less to multiple? Does it want to do a lot of damage or send a player flying through the air, giving the creature some distance as well as leaving the player prone when they land (maybe let the player roll to land on their feet)? Maybe the creature gets advantage for having an ally close by. The idea is that the creature needs to make a choice between effective alternatives. These alternatives can be situational. If they are it means that the players may need to alter their play style in order to prevent their enemy from using their ability. Also don't forget that standard actions aren't the only kind of action. Bonus actions and reactions can also be played with in order to make new interesting and challenging encounters.
If you look through some of the classic D&D creatures, you'll find there are some abilities that completely change how encounters go. Medusas are a classic example of a creature that completely change how an encounter needs to be approached due to their special abilities. I'd also include abilities such as “Frightful Presence” and auras in this class as well. The end result is that the ability incentives a certain kind of play, forces a choice between different disadvantages (turn to stone or be unable to see the medusa), or forces a puzzle to be solved (using a reflective surface against a medusa).
While it can be very useful for making an encounter different, this kind of thing inherently adds complexity on the side of the Dungeon Master. If you are putting your party against 12 skeletons, having 12 different twists and keeping track of them all is usually not feasible because of how much work it. Having 4 skeletons all using the same twist can be enough. Remember to keep in mind the trade-off between making the encounter more complex through things such as twists and the difficulty of running the encounter.