Well attach the pointer to the item data directly to the inventory item. Then you don't need that many if/else.
e.g. on init
action myaction()
{
my->skill42 = sys_malloc(sizeof(item));
//setup item data here
my->skill42->... = ...;
}
and later you can do sth like this:
("ent" being the entity which resembles an inventory item):
inv_float_item(ent->skill42);
I don't know the inventory code, I have never looked at it and never used it, so I'm just guessing what you're trying to do.
The idea is that you have a direct link between the inventory item and your entity, so you don't need endless if/else instructions.