How to create a reference to a standard type in Editor

My object may have a hp parameter of type float.
I want this parameter to be available for drag-and-drop feature of the Editor. For example, I want to be able to put it to different damage scripts as parameter.

I’ve tried the following:

using UnityEngine;
using System.Collections;
using NExtensionMethods;
using System;
using System.Linq.Expressions;


public class param<T> :TDefault
{
	private static readonly Func<T, T, T> add_method;
	private static readonly Func<T, T, T> subtract_method;
	private static readonly Func<T, T, T> multiply_method;
	private static readonly Func<T, T, T> divide_method;
	static param()
	{
		ParameterExpression left = Expression.Parameter(typeof (T), "left");
		ParameterExpression right = Expression.Parameter(typeof (T), "right");
		//Addition
		try
		{
			
			add_method = Expression.Lambda<Func<T, T, T>>(Expression.Add(left, right), left, right).Compile();
		}
		catch (InvalidOperationException)
		{
		}
		//Subtraction
		try
		{
			subtract_method = Expression.Lambda<Func<T, T, T>>(Expression.Subtract(left, right), left, right).Compile();
		}
		catch (InvalidOperationException)
		{
		}
		//Multiplication
		try
		{
			multiply_method = Expression.Lambda<Func<T, T, T>>(Expression.Multiply(left, right), left, right).Compile();
		}
		catch (InvalidOperationException)
		{
		}
		//Division
		try
		{
			divide_method = Expression.Lambda<Func<T, T, T>>(Expression.Divide(left, right), left, right).Compile();
		}
		catch (InvalidOperationException)
		{
		}
	}
	
	public string param_name;
	public T cnt;
	//public Type out_type;
	
	public param()
	{
	}
	public param(T _cnt)
	{
		cnt = _cnt;
	}
	public static implicit operator T(param<T> target)
	{
		return target.cnt;
	}
	public static implicit operator param<T>(T target)//<----THIS CREATES ERROR
	{
		return new param<T>(T);
	}
	public static param<T> operator +(param<T> l, param<T> r)
	{
		if (add_method != null)
		{
			return (new param<T>(add_method(l.cnt, r.cnt))) ;
		}
		return null;
	}
}

    using UnityEngine;
    using System.Collections;
    
    [System.Serializable]
    public class float_param : param<float>
    {
    	public float_param(float _cnt)
    	{
    		cnt=_cnt;
    		//out_type=float_param;
    	}
    }

where TDefault inherits from MonoBehaviour. However, it seems rather complicated: the code always throws warnings about manual creation of MonoBehaviour. Besides, it is impossible to implement conversion operator of generic type in c#.

Are there more elegant solutions?

Actually you can convert generic types. Its a bit tricky to implement but you use Convert.ChangeType

I have to admit though I am confused as to what you are trying to do here? If you want an HP component why don;t you just do

public class HP: MonoBehaviour {
    public float HitPoints;
}

using UnityEngine;
using System.Collections;

public class int_param : MonoBehaviour 
{
	public string param_name;
	public int cnt;
	public int_param(int _cnt)
	{
		cnt=_cnt;
	}
	public static implicit operator int(int_param target) 
	{
		return target.cnt;
	}
	public static implicit operator int_param(int target) 
	{
		return new int_param (target);
	}
}

Actually in this case it’s easier to create a custom class for each standard type than generic for all of them.