How many per cent of the text needs to be changed?
Fanfictions are original works using the setting or characters of another work.
If you change some things and republish, that’s an adaptation.
For example, the recent film Fire Island was an adaptation of Jane Austen’s Pride and Prejudice.
If you are taking an existing publication and just tweaking details (e.g.: character names, locations, dialogue), that’s not fanfic at all; at best that’s an adaptation. If you’re creating a parody (and provide proper citations/attributions to the originating work) it may be fair use. More likely, it’s still considered plagiarism if you can still recognisably see the concepts, structure and inspiration but do not have the author’s permission.
There is no exact percentage for plagiarism, and that is by design in most countries’ legal systems. It is about concepts and ideas, and whether a “reasonable person” could make the connection.
Proper fanfic is where you take existing characters and locations, but put them into an entirely new story / scene / context that never happened in the original work, so is considered “original” in that sense.
There isn’t a legal right of fair use for fan fiction, if that’s what you’re asking. Rights holders often ignore it, though.
This is a variation of the famous Ship of Theseus thought experiment.
Well it’s not because there is a legal answer.
Anything not by the original author or at least with the blessing of the original author should be considered fan fiction.
Nice try, DC.
Not sure you understand what fanfiction even is.
100%
Well, the answer varies a lot based on the copyright owner. If it’s something based on LOTR then the answer is a lot, but if it’s something in the public domain or with a copyright owner that’s not too strict then you may be able to keep a lot of similarities.