This comes from the plays inside territory section of the Gokyo Seimyo. It shows the line through

. As the variations show, at this point Black cannot avoid ko.
In a real game, the ko threat situation is typically significant. Normally, because the defender has more at stake, assuming that the attacker is komaster gives more realistic picture, even if the defender takes the ko first. (If neither player has a ko threat, who takes the ko is more significant, however.)
If White is komaster the line given is not optimal. Please consider what is best play when White is komaster in a real game, where there are many plays, and plays of comparable size on the board. (I am not presenting this as a problem, because best play depends on a number of factors.)
Enjoy!

Note: The komaster can win kos, but the concept is more specific. You can think of it this way. Black has no ko threat, and White has just enough threats to win any ko. That means that White cannot delay winning a ko, because of the threat that Black will take the ko back and White will have no threat.