Just did the math for giggles. To make it to Andromeda in 300 years you'd have to travel at ~7,333 x light speed.
I calculated it to be about ~8,494c @TOS Warp 11 in Intergalactic Space
Speed is calculated from 2,540,000 LY / 299 Years
KIRK: What’s the point of capturing my ship? Even at maximum warp, the Enterprise couldn’t get to Andromeda galaxy for thousands of years.
ROJAN: Captain, we will modify its engines, in order to produce velocities far beyond the reach of your science. The journey between galaxies will take less than three hundred of your years.
ROJAN: And we’ll go faster yet. Increase speed to warp eleven.
KIRK: Increase speed to warp eleven, Mister Chekov.
For comparison at TNG Warp Scale, that would be a little slower than the Enterprise-D's trip back home in "Where No One Has Gone Before":
~8,970c @TNG Warp, E-D's "maximum warp" in S1.
Speed is calculated from 2,700,000 LY / 301 Years
PICARD: That’s not possible. Data, what distance have we travelled?
DATA: Two million seven hundred thousand light years.
LAFORGE: And I calculate that at maximum warp, sir it would take over three hundred years to get home.
In TNG, ~8,970c is somewhere between TNG Warp 9 (833c) and VOY Warp 9.9 (21,457c).
TNG and later appears to favor a "flat" or "universal" speed based on the warp factor. TOS, OTOH, appears to depend on whether the ship is in star system, in interstellar space or in intergalactic space and is fastest in interstellar space (200,000-800,000c range). IMHO.