Using Reflection to get deriving class type from base class

So i followed this great video on reflection: Reflection Example in Unity - YouTube and it was a great introduction to reflection but now i want to know how i could instead have a base class called say for example “ExtendedMonoBehaviour” and have Character inherit from that rather than regular MonoBehaviour so that the CopyWithReflection and PasteWithReflection Context Menus are in ExtendedMonoBehaviour
and it knows that Character is inheriting from it. Basically in the part in the video in the Character script if the line that says “Type characterType = (typeof(Character))” could be replaced to check which script is inheriting from ExtendedMonoBehaviour.

Sorry I hope that is clear enough, I haven’t posted questions much before but am going to start doing so more frequently.

So thought I’d try to tell the base class the inheriting class type like this:

public class ExtendedMonoBehaviour : MonoBehaviour
where TSelf : ExtendedMonoBehaviour

Now i ran into another problem where i can’t really test if it works because the method i want to use is using the ContextMenu attribute and the ContextMenu does not show up in the inheriting class. I’ve done some tests and normally the ContextMenu does work in the inheriting class but when you pass in another class (MyClass) then the Context menu no longer shows up, does anyone know why?