I have never used Function.ReturnValue like that. I always thought it can only be used inside the function.
Try this condition instead:
Function.Call("PlayerSkillSetup", PlayerFamily.UID, "skill_greed1")="skillExists"
Also, make sure there are no "Waits" inside the function.