Hmm. Is the
nitrates being at 40 after a
water change or is it as high as it goes?
Reason being it's not in a location where I'd suspect it was HITH, close but a little too high up on the head and usually lower aroind the eyes, nose and cheeks, and you said it started with a scratch, not a pimple or cyst or bump. That's wouldn't be HITH if it started from a scratch.
It would be a bacterially infected wound. Generally if
nitrites are high, the bad bacteria, the decay bacteria are also high and working overtime beaking stuff down especially when your changing about 100% of the aquarium water a month but the nitrates aren't low and in control and seem to keep running up. It generally means there's waste sitting in the tank that's breaking down.
Nitrates in and of themselves aren't that dangerous, but they get downplayed as to their actual significance on what they indicate, elevated levels of nitrates indicate elevated levels of decay bacteria.
So when nitrates are high, you have a lot more decay bacteria breaking stuff down, that stuff is adding nitrates, as well as dissolved solids. The nitrates and dissolved solids makes living harder on the fish and they get run down, specifically their immune system from stress, then an injury happens and the bacteria can set up shop in the wound and they can't fight it off and heal back up.
Meds will help it, slow it down even get it to clear up but unless you address the root cause of it it's going to return when you stop medicating at some point.
Just my opinion and it looks planted and you probably don't want to hear it but the tank is on 18 months, just water changing, a year and a half of food and poop buildup in the substrate, stuff the filter can't get to because it was too heavy that has settled in.
It's the likely reason your nitrates and bacteria are elevated, and why now wounds aren't healing as they should.
Because it's a year and a half I'd suggest cleaning the substrate, but no more than a quarter to a half the tank at a time until you've gone through it all, (could be some nasty built up at the bottom that releases, and doing it all at once from the start can sometimes kill fish if there's enough of it) then one entire once over to get it completely cleaned out, getting that out of there will make the nitrates manageable again and reduce the bacteria count, de-stressing the fish and allowing their immune systems to strengthen and fight off problems themselves again.
Unless you have plants that are really efficient at getting rid of nitrates and stock in a manner that a balance is created between nitrate production and nitrate consumption, and you don't feel you need to heavy feed to make sure everyone has enough to eat, cleaning the substrate will have to happen or it stacks up out of sight. The water changing alone becomes not enough after a while and the bottom of the tank becomes a bacteria and nitrate factory.
I don't think it's HITH based on the information given, I think it's an infected injury and believe that's your root cause for it getting infected.
I don't believe it's overstocked but it is too heavily stocked for what you are doing with water changing and at this point what's sitting at the bottom is producing more nitrates breaking it down than the plants can use and there's an army down there breaking stuff down. Removing the waste removes their food, and reduces their numbers. The fish will all look better and grow faster if they aren't fighting off bacteria infection attempts constantly also.
Wish you the best of luck! Vacuuming out substrate isn't fun can be a pain and usually messes up a person's entire scape to do it but sometimes it's just got to happen kind of like spring cleaning.
HITH, generally happens with the cichlids sensory pits, it's kind of specific in that regard. the sensory pits are in specific locations and if you really pay attention to the fish you'll see them, along the lateral line in a cluster, and clustered on the face and cheeks, between the nose and eyes they they are for detecting movement and keeping
equilibrium and balance ect. there like tiny pockets or fluid and a fine short hair that detects changes and sends an impulse telling the fish what's going on. those sensory pits will get infected with
Hexamita and it sort of forms a pimple or cyst looking thing that eventually pops and leaves a hole, and does spread along this system of sensory pits to other sensory pits as it progresses. seconday infections with bacteria, Heximita spreads to new pits, ect.
If you aren't seeing it function like that, it's not HITH.
If Heximita, I'd still tell you to clean up the tank, get the nitrates and bacteria down, and supplement the diet as a big step one, before going to medications.