Another option is to set pathfinding speed to 0 when player is in LOS, and reset to normal speed when not in LOS.
I got it to sort of work, but sometimes the enemy doesn't stop walking and walks through walls, but thanks for setting me in the right direction.