I am planning an encounter for a story driven campaign. A 4 player second level party encounters an escaped war elephant, who is making a farmer's life miserable and wrecking his crops. A war elephant is supposed to be a terrifying opponent. A squadron of them is capable of smashing a phalanx of soldiers. In keeping with this, the 5e stats for a regular elephant have it worth 1100 xp. A deadly encounter for this party would be 800 XP, significantly less than the elephant. Although I have a couple of non-combat solutions prepared, I want a combat solution to be on the table; I want a combat solution to be risky but doable. I like the description of "hard" in the DMG; I want the players to worry that this could go badly, but also believe that they will probably win.
Hard. A hard encounter could go badly for the adventurers. Weaker characters might get taken out of the fight, and there's a slim chance that one or more characters might die.
As written in the monster manual, the elephant does an average of 39 damage if it hits with both its gore and its stomp; enough to turn a second level fighter into giblets. It also has enough HP that the party would take several rounds to kill it, even if it rolls nothing but 1s.
What can I do to nerf this elephant into a more doable encounter? How do I know that this encounter is actually level appropriate?
How can I signal these nerfs to the players? I want them to know what choice they are making, before they make it.
I have a few ideas for solutions banging around my head, but I don't know that they will work. If I over-nerf the elephant, the combat is trivial. If I under-nerf it, I kill the players.
Solution 1: A barbed spear is hanging out of the elephant's side and pus is seeping from the wound. Mechanically the elephant has fewer hit points, but he can still murder any PC in a single round. This doesn't do everything I want.
Solution 2: The elephant is tangled in its armor, and has its move speed reduced to 15 feet. This prevents it from using its "trampling charge" ability. The average damage would fall from 39 to 18, still a very serious amount. It can down any party member in one hit if it rolls decently, and kill the squishy ones. This also means that a clever party member with a bow can stand back and snipe the thing indefinitely.
Solution 3: The elephant is severely dehydrated. It has the level of exhaustion that gives it disadvantage on all rolls.
I want to know if these solutions adjust a elephant to the proper difficulty level. I will also accept answers with other solutions.
If necessary I will accept answers from experience, but I would very much appreciate written guidelines. This situation will probably come up again, and I would like to be able to answer it for myself.