There may be a simpler way to go about this, but you could pin an invisible box sprite to the creature. While the box is overlapping the barricade, use an Every X seconds event to have the rest run every 1 second.
Using the box with Is Overlapping would allow it to check the proximity constantly, rather than only once like On Collision, which would be necessary to check if it should attack every second.