He might be shocked at first. Then he could feel a strong sense of protectiveness towards Harry. Maybe he immediately tries to find ways to keep Harry safe from further harm, like staying closer to him at all times.
In this kind of fanfiction, Cedric might feel shocked and angry. He could decide to protect Harry from further harm. Maybe he'll try to find the abuser and put a stop to it.
Cedric would be deeply troubled. In the wizarding world, they have their own code of honor and respect. Finding out about Harry's abused fanfiction would go against everything Cedric stands for. He might start to question the morality of the Muggle world that allows such things to be written. He would also feel a sense of sadness for Harry, knowing that someone out there has created a story that portrays him in such a negative and harmful light. Cedric might even consider taking some sort of action, like talking to Harry about it or trying to get the fanfiction removed if he could, though that would be a complex matter given the nature of fanfiction and the different worlds they live in.
Sam could be in shock at first. Then he might start to dig deeper into Dean's past to understand the full extent of the abuse. He would likely try to get Dean to open up more about it and offer his support in any way he can. For example, he could be more understanding when Dean has certain triggers related to the abuse.
In this kind of fanfiction, there could be a lot of shock and disbelief among the characters at first. His friends might feel guilty for not noticing the signs earlier. They would probably become extremely protective of Percy.