Theoretical study of ThF$^+$ in the search for T,P-violation effects: Effective state of a Th atom in ThF$^+$ and ThO compounds