It’s very simple; your version is incorrect. It’s not related to experience.
Added 1 minute ago
If anything, this was checked in the beta version of the game, and it turns out that it’s exactly a certain number of levels. True, I didn’t check it myself, but still.
"When the hero meets another friendly hero, the latter gains up to 50% of the hero's experience."
Level, so level. But still, in my opinion, you’re writing too complicated. "If the hero has this ability, then the level of the encountered allied hero will increase. This will continue until his level is half the level of the first hero."
You could try this: "If the hero has this ability, then the level of the encountered allied hero increases to half the level of the first hero."
But, as I said, write as you like.
For example, they could hire a theater troupe and put on a half-hour performance outdoors during a lunar eclipse. They could broadcast it online. And for this short time, maybe for 2-3 hours, they could open FREE access for all Heroes fans to download the beta; after all, it’s still a beta.

