Remember that Kagi is more about the colouring scheme than a different calculation. You can use PERCENTSWING() and POINTSWING() and get the same shape.
The change in colour on a Kagi is based on the Trend rules of swings. So you can use the SWINGTRENDUP() and SWINGTRENDDOWN() functions to know which direction the trend is heading.
eg
s1 = PERCENTSWING(PERCENT=3.0);
SWINGTRENDUP(s1)
You can see below that it captures when the percent swing changes to an uptrend by taking out the previous high (black arrows).