There is a much easier technique than all the maths above
Just use Overlapping with Offset. Suppose if sprite A is to be hit by sprite B from top. Then:
--------------------------------------------------------------------------
[A] On Collision with
[A] is overlapping with with offset (X: 0, Y: -2)
---------------------------------------------------------------------------
This way, once A gets collided with B, it will check 2 pixels above it if B is there or not.